mirror of https://github.com/zkat/miette.git
fix(clippy): Add missing semicolons where nothing is returned. (#293)
This commit is contained in:
parent
1f448e4775
commit
06b348230a
|
|
@ -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')?;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ impl JSONReportHandler {
|
|||
}
|
||||
write!(f, r#""{}""#, escape(&error.to_string()))?;
|
||||
}
|
||||
write!(f, "],")?
|
||||
write!(f, "],")?;
|
||||
} else {
|
||||
write!(f, r#""causes": [],"#)?;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue