georust / geo

Geospatial primitives and algorithms for Rust
https://crates.io/crates/geo
Other
1.47k stars 190 forks source link

Minor: (clippy) List constraint on T in only one place. #1164

Closed martinfrances107 closed 3 months ago

martinfrances107 commented 3 months ago

I love this project it is really useful.

I saw this minor blemish while reading the code.

Constraints on T are detailed in two places, once before the function arguments and THEN they are augmented in a WHERE clause.

This for me is a readability issues... I think all constraints should be in one place.

-fn prepare_dataset<'a, T: 'a>(coords: impl Iterator<Item = &'a Coord<T>>) -> rstar::RTree<Coord<T>>
+fn prepare_dataset<'a, T>(coords: impl Iterator<Item = &'a Coord<T>>) -> rstar::RTree<Coord<T>>
 where
-    T: GeoFloat + RTreeNum,
+    T: 'a + GeoFloat + RTreeNum,

Also after checking .. I cleared an addional warning about this form the clippy warning logs.