Merge pull request #1267 from gwenn/clippy

[breaking change] Update edition from 2018 to 2021
This commit is contained in:
gwenn
2023-06-17 07:44:02 +02:00
committed by GitHub
15 changed files with 45 additions and 71 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),
@@ -273,7 +272,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

@@ -353,7 +353,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(())