Cargo clippy: fix the majority of errors

This commit is contained in:
Igor Katson 2022-12-08 20:20:23 +00:00
parent 871d927596
commit 6968a4e449
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
19 changed files with 69 additions and 91 deletions

View file

@ -12,7 +12,7 @@ pub enum SerErrorKind {
impl std::fmt::Display for SerErrorKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
SerErrorKind::Other(e) => write!(f, "{}", e),
SerErrorKind::Other(e) => write!(f, "{e}"),
}
}
}
@ -84,7 +84,7 @@ impl<W: std::io::Write> BencodeSerializer<W> {
self.write_raw(&[byte])
}
fn write_number<N: std::fmt::Display>(&mut self, number: N) -> Result<(), SerError> {
self.write_fmt(format_args!("i{}e", number))
self.write_fmt(format_args!("i{number}e"))
}
fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), SerError> {
if !self.hack_no_bytestring_prefix {