fix(clippy): Add missing semicolons where nothing is returned. (#293)

This commit is contained in:
Bruce Mitchener 2023-09-26 00:33:07 +07:00 committed by GitHub
parent 1f448e4775
commit 06b348230a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -678,10 +678,10 @@ impl GraphicalReportHandler {
for (c, width) in text.chars().zip(self.line_visual_char_width(text)) { for (c, width) in text.chars().zip(self.line_visual_char_width(text)) {
if c == '\t' { if c == '\t' {
for _ in 0..width { for _ in 0..width {
f.write_char(' ')? f.write_char(' ')?;
} }
} else { } else {
f.write_char(c)? f.write_char(c)?;
} }
} }
f.write_char('\n')?; f.write_char('\n')?;

View File

@ -96,7 +96,7 @@ impl JSONReportHandler {
} }
write!(f, r#""{}""#, escape(&error.to_string()))?; write!(f, r#""{}""#, escape(&error.to_string()))?;
} }
write!(f, "],")? write!(f, "],")?;
} else { } else {
write!(f, r#""causes": [],"#)?; write!(f, r#""causes": [],"#)?;
} }

View File

@ -379,7 +379,7 @@ fn test_serialize_labeled_span() {
"span": { "offset": 0, "length": 0, }, "span": { "offset": 0, "length": 0, },
"primary": false, "primary": false,
}) })
) );
} }
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
@ -408,7 +408,7 @@ fn test_deserialize_labeled_span() {
"primary": false "primary": false
})) }))
.unwrap(); .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!( assert_eq!(
json!(SourceSpan::from(0)), json!(SourceSpan::from(0)),
json!({ "offset": 0, "length": 0}) json!({ "offset": 0, "length": 0})
) );
} }
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
@ -606,7 +606,7 @@ fn test_deserialize_source_span() {
use serde_json::json; use serde_json::json;
let span: SourceSpan = serde_json::from_value(json!({ "offset": 0, "length": 0})).unwrap(); 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() { fn test_serialize_source_offset() {
use serde_json::json; use serde_json::json;
assert_eq!(json!(SourceOffset::from(0)), 0) assert_eq!(json!(SourceOffset::from(0)), 0);
} }
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
#[test] #[test]
fn test_deserialize_source_offset() { fn test_deserialize_source_offset() {
let offset: SourceOffset = serde_json::from_str("0").unwrap(); let offset: SourceOffset = serde_json::from_str("0").unwrap();
assert_eq!(offset, SourceOffset::from(0)) assert_eq!(offset, SourceOffset::from(0));
} }

View File

@ -568,7 +568,7 @@ fn test_unit_struct_display() {
#[error("unit only")] #[error("unit only")]
#[diagnostic(code(foo::bar::overridden), help("hello from unit help"))] #[diagnostic(code(foo::bar::overridden), help("hello from unit help"))]
struct UnitOnly; 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] #[test]
@ -582,5 +582,5 @@ fn test_unit_enum_display() {
assert_eq!( assert_eq!(
Enum::UnitVariant.help().unwrap().to_string(), Enum::UnitVariant.help().unwrap().to_string(),
"hello from unit help" "hello from unit help"
) );
} }