Skip to content

Commit f8d2f30

Browse files
committed
Thanks clippy
Since Rust 1.74.0, there is an `other` function to make an `ErrorKind::Other`. This helps make code shorter and more readable. - https://doc.rust-lang.org/std/io/struct.Error.html#method.other Using that function fixes two `clippy` errors.
1 parent aac2e4b commit f8d2f30

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Support {
4141
{
4242
Ok(())
4343
} else {
44-
Err(io::Error::new(io::ErrorKind::Other, "bat exited with an error"))
44+
Err(io::Error::other("bat exited with an error"))
4545
}
4646
}
4747
}

src/command/changelog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> {
9797
},
9898
capitalize_commit,
9999
)
100-
.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?;
100+
.map_err(std::io::Error::other)?;
101101
file.write_all(buf.as_bytes())
102102
})?;
103103
if let Some(bat) = bat.as_ref() {

0 commit comments

Comments
 (0)