Skip to content

Commit

Permalink
fix(clippy): Add missing semicolons where nothing is returned. (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Sep 25, 2023
1 parent 1f448e4 commit 06b3482
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/handlers/graphical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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')?;
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl JSONReportHandler {
}
write!(f, r#""{}""#, escape(&error.to_string()))?;
}
write!(f, "],")?
write!(f, "],")?;
} else {
write!(f, r#""causes": [],"#)?;
}
Expand Down
12 changes: 6 additions & 6 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ fn test_serialize_labeled_span() {
"span": { "offset": 0, "length": 0, },
"primary": false,
})
)
);
}

#[cfg(feature = "serde")]
Expand Down Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -597,7 +597,7 @@ fn test_serialize_source_span() {
assert_eq!(
json!(SourceSpan::from(0)),
json!({ "offset": 0, "length": 0})
)
);
}

#[cfg(feature = "serde")]
Expand All @@ -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));
}

/**
Expand Down Expand Up @@ -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));
}
4 changes: 2 additions & 2 deletions tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -582,5 +582,5 @@ fn test_unit_enum_display() {
assert_eq!(
Enum::UnitVariant.help().unwrap().to_string(),
"hello from unit help"
)
);
}

0 comments on commit 06b3482

Please sign in to comment.