From 06b348230aaf153b8b050322f05e5d185351d2d1 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 26 Sep 2023 00:33:07 +0700 Subject: [PATCH] fix(clippy): Add missing semicolons where nothing is returned. (#293) --- src/handlers/graphical.rs | 4 ++-- src/handlers/json.rs | 2 +- src/protocol.rs | 12 ++++++------ tests/derive.rs | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/handlers/graphical.rs b/src/handlers/graphical.rs index a7399fd8..770944d8 100644 --- a/src/handlers/graphical.rs +++ b/src/handlers/graphical.rs @@ -678,10 +678,10 @@ impl GraphicalReportHandler { for (c, width) in text.chars().zip(self.line_visual_char_width(text)) { if c == '\t' { for _ in 0..width { - f.write_char(' ')? + f.write_char(' ')?; } } else { - f.write_char(c)? + f.write_char(c)?; } } f.write_char('\n')?; diff --git a/src/handlers/json.rs b/src/handlers/json.rs index 29e21a0d..0b4a405b 100644 --- a/src/handlers/json.rs +++ b/src/handlers/json.rs @@ -96,7 +96,7 @@ impl JSONReportHandler { } write!(f, r#""{}""#, escape(&error.to_string()))?; } - write!(f, "],")? + write!(f, "],")?; } else { write!(f, r#""causes": [],"#)?; } diff --git a/src/protocol.rs b/src/protocol.rs index be313b13..4a6012c7 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -379,7 +379,7 @@ fn test_serialize_labeled_span() { "span": { "offset": 0, "length": 0, }, "primary": false, }) - ) + ); } #[cfg(feature = "serde")] @@ -408,7 +408,7 @@ fn test_deserialize_labeled_span() { "primary": false })) .unwrap(); - assert_eq!(span, LabeledSpan::new(Some("label".to_string()), 0, 0)) + assert_eq!(span, LabeledSpan::new(Some("label".to_string()), 0, 0)); } /** @@ -597,7 +597,7 @@ fn test_serialize_source_span() { assert_eq!( json!(SourceSpan::from(0)), json!({ "offset": 0, "length": 0}) - ) + ); } #[cfg(feature = "serde")] @@ -606,7 +606,7 @@ fn test_deserialize_source_span() { use serde_json::json; let span: SourceSpan = serde_json::from_value(json!({ "offset": 0, "length": 0})).unwrap(); - assert_eq!(span, SourceSpan::from(0)) + assert_eq!(span, SourceSpan::from(0)); } /** @@ -708,12 +708,12 @@ fn test_source_offset_from_location() { fn test_serialize_source_offset() { use serde_json::json; - assert_eq!(json!(SourceOffset::from(0)), 0) + assert_eq!(json!(SourceOffset::from(0)), 0); } #[cfg(feature = "serde")] #[test] fn test_deserialize_source_offset() { let offset: SourceOffset = serde_json::from_str("0").unwrap(); - assert_eq!(offset, SourceOffset::from(0)) + assert_eq!(offset, SourceOffset::from(0)); } diff --git a/tests/derive.rs b/tests/derive.rs index dbaf7cb4..f4739a7c 100644 --- a/tests/derive.rs +++ b/tests/derive.rs @@ -568,7 +568,7 @@ fn test_unit_struct_display() { #[error("unit only")] #[diagnostic(code(foo::bar::overridden), help("hello from unit help"))] struct UnitOnly; - assert_eq!(UnitOnly.help().unwrap().to_string(), "hello from unit help") + assert_eq!(UnitOnly.help().unwrap().to_string(), "hello from unit help"); } #[test] @@ -582,5 +582,5 @@ fn test_unit_enum_display() { assert_eq!( Enum::UnitVariant.help().unwrap().to_string(), "hello from unit help" - ) + ); }