diff options
author | Matthias Beyer <matthias.beyer@ifm.com> | 2022-07-22 08:23:41 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@ifm.com> | 2022-08-18 14:46:54 +0200 |
commit | 64b16a489041398f40a10f65877bb539b4906103 (patch) | |
tree | e2b2a3b4feaf4ac3561268f49da8e8e657dee546 /crates/core | |
parent | 9063f88c43293f19f3400f0ed97b3a301f13ef5b (diff) |
Fix clippy in thin_edge_json: Remove let-unit-value
This patch fixes `clippy::let_unit_value`.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Diffstat (limited to 'crates/core')
-rw-r--r-- | crates/core/thin_edge_json/src/measurement.rs | 6 | ||||
-rw-r--r-- | crates/core/thin_edge_json/src/parser.rs | 19 | ||||
-rw-r--r-- | crates/core/thin_edge_json/src/serialize.rs | 2 |
3 files changed, 12 insertions, 15 deletions
diff --git a/crates/core/thin_edge_json/src/measurement.rs b/crates/core/thin_edge_json/src/measurement.rs index 13be5190..51058db0 100644 --- a/crates/core/thin_edge_json/src/measurement.rs +++ b/crates/core/thin_edge_json/src/measurement.rs @@ -88,9 +88,9 @@ pub trait MeasurementVisitor { name: &str, value: f64, ) -> Result<(), Self::Error> { - let () = self.visit_start_group(group)?; - let () = self.visit_measurement(name, value)?; - let () = self.visit_end_group()?; + self.visit_start_group(group)?; + self.visit_measurement(name, value)?; + self.visit_end_group()?; Ok(()) } } diff --git a/crates/core/thin_edge_json/src/parser.rs b/crates/core/thin_edge_json/src/parser.rs index 297be75e..88db5e73 100644 --- a/crates/core/thin_edge_json/src/parser.rs +++ b/crates/core/thin_edge_json/src/parser.rs @@ -21,7 +21,7 @@ pub fn parse_str<T: MeasurementVisitor>( let parser = ThinEdgeJsonParser { visitor }; - let () = deserializer + deserializer .deserialize_map(parser) .map_err(|error| map_error(error, input))?; Ok(()) @@ -105,8 +105,7 @@ where ) .map_err(|err| de::Error::custom(invalid_timestamp(timestamp_str, err)))?; - let () = self - .visitor + self.visitor .visit_timestamp(timestamp) .map_err(de::Error::custom)?; } @@ -117,7 +116,7 @@ where visitor: self.visitor, }; - let () = map.next_value_seed(parser)?; + map.next_value_seed(parser)?; measurements_count += 1; } } @@ -156,8 +155,7 @@ where return Err(de::Error::custom("Expect single-value measurement")); } - let () = self - .visitor + self.visitor .visit_start_group(self.key.as_ref()) .map_err(de::Error::custom)?; @@ -170,7 +168,7 @@ where visitor: self.visitor, }; - let () = map.next_value_seed(parser)?; + map.next_value_seed(parser)?; measurements_count += 1; } @@ -178,7 +176,7 @@ where return Err(de::Error::custom(invalid_empty_measurement(&self.key))); } - let () = self.visitor.visit_end_group().map_err(de::Error::custom)?; + self.visitor.visit_end_group().map_err(de::Error::custom)?; Ok(()) } @@ -204,8 +202,7 @@ where return Err(de::Error::custom(invalid_json_number(&self.key))); } - let () = self - .visitor + self.visitor .visit_measurement(self.key.as_ref(), value) .map_err(de::Error::custom)?; @@ -319,7 +316,7 @@ mod tests { let mut builder = ThinEdgeJsonBuilder::default(); - let () = parse_str(input, &mut builder)?; + parse_str(input, &mut builder)?; let output = builder.done()?; diff --git a/crates/core/thin_edge_json/src/serialize.rs b/crates/core/thin_edge_json/src/serialize.rs index 0c307ec0..373d76ec 100644 --- a/crates/core/thin_edge_json/src/serialize.rs +++ b/crates/core/thin_edge_json/src/serialize.rs @@ -67,7 +67,7 @@ impl ThinEdgeJsonSerializer { if !self.timestamp_present { if let Some(default_timestamp) = self.default_timestamp { - let () = self.visit_timestamp(default_timestamp)?; + self.visit_timestamp(default_timestamp)?; } } |