@@ -7,7 +7,8 @@ use ::{CoordinateType, Point};
7
7
pub static COORD_PRECISION : f32 = 1e-1 ; // 0.1m
8
8
9
9
/// A container for the bounding box of a [`Geometry`](enum.Geometry.html)
10
- #[ derive( PartialEq , Clone , Copy , Debug , Serialize , Deserialize ) ]
10
+ #[ cfg_attr( feature = "use-serde" , derive( Serialize , Deserialize ) ) ]
11
+ #[ derive( PartialEq , Clone , Copy , Debug ) ]
11
12
pub struct Bbox < T >
12
13
where
13
14
T : CoordinateType ,
19
20
}
20
21
21
22
/// A container for indices of the minimum and maximum points of a [`Geometry`](enum.Geometry.html)
22
- #[ derive( PartialEq , Clone , Copy , Debug , Serialize , Deserialize ) ]
23
+ #[ cfg_attr( feature = "use-serde" , derive( Serialize , Deserialize ) ) ]
24
+ #[ derive( PartialEq , Clone , Copy , Debug ) ]
23
25
pub struct Extremes {
24
26
pub ymin : usize ,
25
27
pub xmax : usize ,
@@ -39,7 +41,8 @@ impl From<Vec<usize>> for Extremes {
39
41
}
40
42
41
43
/// A container for the coordinates of the minimum and maximum points of a [`Geometry`](enum.Geometry.html)
42
- #[ derive( PartialEq , Clone , Copy , Debug , Serialize , Deserialize ) ]
44
+ #[ cfg_attr( feature = "use-serde" , derive( Serialize , Deserialize ) ) ]
45
+ #[ derive( PartialEq , Clone , Copy , Debug ) ]
43
46
pub struct ExtremePoint < T >
44
47
where
45
48
T : CoordinateType ,
@@ -139,7 +142,8 @@ where
139
142
}
140
143
141
144
/// The result of trying to find the closest spot on an object to a point.
142
- #[ derive( Debug , Clone , Copy , PartialEq , Serialize , Deserialize ) ]
145
+ #[ cfg_attr( feature = "use-serde" , derive( Serialize , Deserialize ) ) ]
146
+ #[ derive( Debug , Clone , Copy , PartialEq ) ]
143
147
pub enum Closest < F : Float > {
144
148
/// The point actually intersects with the object.
145
149
Intersection ( Point < F > ) ,
0 commit comments