File tree 3 files changed +15
-6
lines changed
3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ use-serde = ["serde", "geo-types/serde"]
34
34
[dev-dependencies ]
35
35
approx = " 0.3.0"
36
36
criterion = { version = " 0.3" }
37
- png = " 0.16.7"
38
- float_extras = " 0.1.6"
39
37
40
38
[[bench ]]
41
39
name = " area"
Original file line number Diff line number Diff line change @@ -45,7 +45,11 @@ pub trait HasKernel: CoordinateType {
45
45
type Ker : Kernel < Scalar = Self > ;
46
46
}
47
47
48
- #[ macro_export]
48
+ // Helper macro to implement `HasKernel` on a a scalar type
49
+ // `T` (first arg.) by assigning the second arg. It expects
50
+ // the second arg. to be a type that takes one generic
51
+ // parameter that is `T`.
52
+ #[ macro_use]
49
53
macro_rules! has_kernel {
50
54
( $t: ident, $k: ident) => {
51
55
impl $crate:: algorithm:: kernels:: HasKernel for $t {
@@ -59,8 +63,13 @@ pub use self::robust::RobustKernel;
59
63
has_kernel ! ( f64 , RobustKernel ) ;
60
64
has_kernel ! ( f32 , RobustKernel ) ;
61
65
62
-
63
66
pub mod simple;
64
67
pub use self :: simple:: SimpleKernel ;
68
+
65
69
has_kernel ! ( i64 , SimpleKernel ) ;
66
70
has_kernel ! ( i32 , SimpleKernel ) ;
71
+ has_kernel ! ( i16 , SimpleKernel ) ;
72
+ has_kernel ! ( isize , SimpleKernel ) ;
73
+
74
+ #[ cfg( has_i128) ]
75
+ has_kernel ! ( i128 , SimpleKernel ) ;
Original file line number Diff line number Diff line change @@ -127,8 +127,10 @@ where
127
127
}
128
128
}
129
129
130
- /// Compute index of the lexicographically least point.
131
- /// Should only be called on a non-empty slice.
130
+ /// Compute index of the lexicographically least point. In
131
+ /// other words, point with minimum `x` coord, and breaking
132
+ /// ties with minimum `y` coord. Should only be called on a
133
+ /// non-empty slice with no `nan` coordinates.
132
134
pub fn lexicographically_least_index < T : Copy + PartialOrd > ( pts : & [ T ] ) -> usize {
133
135
assert ! ( pts. len( ) > 0 ) ;
134
136
You can’t perform that action at this time.
0 commit comments