Skip to content

Commit 81b70d3

Browse files
authored
Merge pull request #492 from nyurik/inline-fmt
Inline a few format args for readability
2 parents 9919851 + 10a7eff commit 81b70d3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

embedded-io-adapters/src/std.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,5 @@ impl<T: embedded_io::Seek + ?Sized> std::io::Seek for ToStd<T> {
118118

119119
/// Convert a embedded-io error to a std::io::Error
120120
pub fn to_std_error<T: embedded_io::Error>(err: T) -> std::io::Error {
121-
std::io::Error::new(err.kind().into(), format!("{:?}", err))
121+
std::io::Error::new(err.kind().into(), format!("{err:?}"))
122122
}

embedded-io/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ impl From<ReadExactError<std::io::Error>> for std::io::Error {
243243
std::io::ErrorKind::UnexpectedEof,
244244
"UnexpectedEof".to_owned(),
245245
),
246-
ReadExactError::Other(e) => std::io::Error::new(e.kind(), format!("{:?}", e)),
246+
ReadExactError::Other(e) => std::io::Error::new(e.kind(), format!("{e:?}")),
247247
}
248248
}
249249
}
@@ -256,14 +256,14 @@ impl From<WriteAllError<std::io::Error>> for std::io::Error {
256256
WriteAllError::WriteZero => {
257257
std::io::Error::new(std::io::ErrorKind::WriteZero, "WriteZero".to_owned())
258258
}
259-
WriteAllError::Other(e) => std::io::Error::new(e.kind(), format!("{:?}", e)),
259+
WriteAllError::Other(e) => std::io::Error::new(e.kind(), format!("{e:?}")),
260260
}
261261
}
262262
}
263263

264264
impl<E: fmt::Debug> fmt::Display for ReadExactError<E> {
265265
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
266-
write!(f, "{:?}", self)
266+
write!(f, "{self:?}")
267267
}
268268
}
269269

@@ -291,7 +291,7 @@ impl<E> From<E> for WriteFmtError<E> {
291291

292292
impl<E: fmt::Debug> fmt::Display for WriteFmtError<E> {
293293
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
294-
write!(f, "{:?}", self)
294+
write!(f, "{self:?}")
295295
}
296296
}
297297

@@ -317,7 +317,7 @@ impl<E> From<E> for WriteAllError<E> {
317317

318318
impl<E: fmt::Debug> fmt::Display for WriteAllError<E> {
319319
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
320-
write!(f, "{:?}", self)
320+
write!(f, "{self:?}")
321321
}
322322
}
323323

0 commit comments

Comments
 (0)