Skip to content

Commit 33bdc20

Browse files
committed
Use new-style format strings
1 parent e22d277 commit 33bdc20

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ impl<E: fmt::Debug + Error + 'static> Error for ParseNotNanError<E> {
19111911
impl<E: fmt::Display> fmt::Display for ParseNotNanError<E> {
19121912
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
19131913
match self {
1914-
ParseNotNanError::ParseFloatError(e) => write!(f, "Parse error: {}", e),
1914+
ParseNotNanError::ParseFloatError(e) => write!(f, "Parse error: {e}"),
19151915
ParseNotNanError::IsNaN => write!(f, "NotNan parser encounter a NaN"),
19161916
}
19171917
}
@@ -2333,7 +2333,7 @@ mod impl_speedy {
23332333
fn read_from<R: Reader<'a, C>>(reader: &mut R) -> Result<Self, C::Error> {
23342334
let value: T = reader.read_value()?;
23352335
Self::new(value).map_err(|error| {
2336-
speedy::Error::custom(std::format!("failed to read NotNan: {}", error)).into()
2336+
speedy::Error::custom(std::format!("failed to read NotNan: {error}")).into()
23372337
})
23382338
}
23392339

tests/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ fn hash_is_good_for_whole_numbers() {
475475
// many, but should guard against transient issues
476476
// that will result from using RandomState
477477
let pct_unique = set.len() as f64 / limit as f64;
478-
assert!(0.99f64 < pct_unique, "percent-unique={}", pct_unique);
478+
assert!(0.99f64 < pct_unique, "percent-unique={pct_unique}");
479479
}
480480

481481
#[test]
@@ -494,7 +494,7 @@ fn hash_is_good_for_fractional_numbers() {
494494
// many, but should guard against transient issues
495495
// that will result from using RandomState
496496
let pct_unique = set.len() as f64 / limit as f64;
497-
assert!(0.99f64 < pct_unique, "percent-unique={}", pct_unique);
497+
assert!(0.99f64 < pct_unique, "percent-unique={pct_unique}");
498498
}
499499

500500
#[test]

0 commit comments

Comments
 (0)