From 363e94aa2893c73585b9a71054d2abe75aef5df9 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Fri, 9 Aug 2024 18:10:59 +0200 Subject: [PATCH] Update dependencies and fix linter warnings --- Cargo.toml | 2 +- src/morton.rs | 2 +- src/sfc.rs | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9ace755..0754e6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,4 +26,4 @@ arrayref = "0.3" log = { version = "0.4", features = ["max_level_trace", "release_max_level_trace"] } serde = { version = "1.0", features = ["derive"] } -bincode = "1.3.0" +bincode = "1.3" diff --git a/src/morton.rs b/src/morton.rs index e72ba7b..3e0a423 100644 --- a/src/morton.rs +++ b/src/morton.rs @@ -171,7 +171,7 @@ impl<'de> Deserialize<'de> for MortonEncoder { enum Field { CellBits, Dimensions, - }; + } impl<'de> Deserialize<'de> for Field { fn deserialize(deserializer: D) -> Result diff --git a/src/sfc.rs b/src/sfc.rs index dd97063..e0f4ed3 100644 --- a/src/sfc.rs +++ b/src/sfc.rs @@ -190,14 +190,14 @@ where } fn value(&self, code: SFCCode, offsets: &[SFCOffset]) -> Result, String> { - Ok(self.space.value( + self.space.value( self.morton .decode(code) .iter() .map(|e| *e as usize) .collect(), offsets.iter().map(|e| *e as usize).collect(), - )?) + ) } // Build coordinate values from encoded value @@ -301,7 +301,7 @@ where Ok(last) => Some((idx, first, last)), } }) - .map(move |(idx, first, last)| { + .flat_map(move |(idx, first, last)| { // Check first & last point of the cell, if both are fully // in the bounding box, then all the points of the cell will // be. @@ -341,8 +341,7 @@ where }; b - }) - .flatten(); + }); Box::new(iter) } Err(e) => {