[breaking change] Update edition from 2018 to 2021

And fix clippy warnings
This commit is contained in:
gwenn
2022-12-09 20:16:38 +01:00
parent 51a69b1b74
commit 3aa9addaa3
17 changed files with 47 additions and 73 deletions

View File

@@ -59,8 +59,7 @@ impl fmt::Display for FromSqlError {
} => {
write!(
f,
"Cannot read {} byte value out of {} byte blob",
expected_size, blob_size
"Cannot read {expected_size} byte value out of {blob_size} byte blob"
)
}
FromSqlError::Other(ref err) => err.fmt(f),
@@ -248,7 +247,7 @@ mod test {
.unwrap_err();
match err {
Error::IntegralValueOutOfRange(_, value) => assert_eq!(*n, value),
_ => panic!("unexpected error: {}", err),
_ => panic!("unexpected error: {err}"),
}
}
for n in in_range {

View File

@@ -352,7 +352,7 @@ mod test {
assert_eq!(Value::Integer(1), row.get::<_, Value>(2)?);
match row.get::<_, Value>(3)? {
Value::Real(val) => assert!((1.5 - val).abs() < f64::EPSILON),
x => panic!("Invalid Value {:?}", x),
x => panic!("Invalid Value {x:?}"),
}
assert_eq!(Value::Null, row.get::<_, Value>(4)?);
Ok(())

View File

@@ -74,7 +74,7 @@ mod test {
);
}
e => {
panic!("Expected conversion failure, got {}", e);
panic!("Expected conversion failure, got {e}");
}
}
Ok(())