Skip to content

Commit fb3d0f8

Browse files
committed
fixup nostd build of geo-types macros
1 parent 19db287 commit fb3d0f8

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

geo-types/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ pub mod _alloc {
154154
//! Needed to access these types from `alloc` in macros when the std feature is
155155
//! disabled and the calling context is missing `extern crate alloc`. These are
156156
//! _not_ meant for public use.
157-
158-
pub use ::alloc::boxed::Box;
159157
pub use ::alloc::vec;
160158
}
161159

geo-types/src/macros.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ macro_rules! coord {
123123
/// [`LineString`]: ./line_string/struct.LineString.html
124124
#[macro_export]
125125
macro_rules! line_string {
126-
() => { $crate::LineString::new(vec![]) };
126+
() => { $crate::LineString::new($crate::_alloc::vec![]) };
127127
(
128128
$(( $($tag:tt : $val:expr),* $(,)? )),*
129129
$(,)?
@@ -139,11 +139,9 @@ macro_rules! line_string {
139139
$(,)?
140140
) => {
141141
$crate::LineString::new(
142-
<[_]>::into_vec(
143-
$crate::_alloc::Box::new(
144-
[$($coord), *]
145-
)
146-
)
142+
$crate::_alloc::vec![
143+
$($coord),*
144+
]
147145
)
148146
};
149147
}
@@ -216,7 +214,7 @@ macro_rules! line_string {
216214
/// [`Polygon`]: ./struct.Polygon.html
217215
#[macro_export]
218216
macro_rules! polygon {
219-
() => { $crate::Polygon::new($crate::line_string![], vec![]) };
217+
() => { $crate::Polygon::new($crate::line_string![], $crate::_alloc::vec![]) };
220218
(
221219
exterior: [
222220
$(( $($exterior_tag:tt : $exterior_val:expr),* $(,)? )),*
@@ -262,15 +260,11 @@ macro_rules! polygon {
262260
$crate::line_string![
263261
$($exterior_coord), *
264262
],
265-
<[_]>::into_vec(
266-
$crate::_alloc::Box::new(
267-
[
268-
$(
269-
$crate::line_string![$($interior_coord),*]
270-
), *
271-
]
272-
)
273-
)
263+
$crate::_alloc::vec![
264+
$(
265+
$crate::line_string![$($interior_coord),*]
266+
), *
267+
]
274268
)
275269
};
276270
(

geo-types/src/wkt_macro.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ macro_rules! wkt_internal {
141141
#[cfg(test)]
142142
mod test {
143143
use crate::geometry::*;
144+
use alloc::vec;
144145

145146
#[test]
146147
fn point() {

0 commit comments

Comments
 (0)