Skip to content

Commit 2e1df6a

Browse files
Merge pull request #1675 from rust-osdev/clippy
clippy: fix upcoming nightly lints
2 parents 9b9e621 + 2d8f7d3 commit 2e1df6a

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

uefi/src/data_types/strs.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub enum FromSliceUntilNulError {
3131
impl Display for FromSliceUntilNulError {
3232
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
3333
match self {
34-
Self::InvalidChar(usize) => write!(f, "invalid character at index {}", usize),
34+
Self::InvalidChar(usize) => write!(f, "invalid character at index {usize}"),
3535
Self::NoNul => write!(f, "no nul character"),
3636
}
3737
}
@@ -56,8 +56,8 @@ pub enum FromSliceWithNulError {
5656
impl Display for FromSliceWithNulError {
5757
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
5858
match self {
59-
Self::InvalidChar(usize) => write!(f, "invalid character at index {}", usize),
60-
Self::InteriorNul(usize) => write!(f, "interior null character at index {}", usize),
59+
Self::InvalidChar(usize) => write!(f, "invalid character at index {usize}"),
60+
Self::InteriorNul(usize) => write!(f, "interior null character at index {usize}"),
6161
Self::NotNulTerminated => write!(f, "not null-terminated"),
6262
}
6363
}
@@ -85,8 +85,8 @@ pub enum UnalignedCStr16Error {
8585
impl Display for UnalignedCStr16Error {
8686
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
8787
match self {
88-
Self::InvalidChar(usize) => write!(f, "invalid character at index {}", usize),
89-
Self::InteriorNul(usize) => write!(f, "interior null character at index {}", usize),
88+
Self::InvalidChar(usize) => write!(f, "invalid character at index {usize}"),
89+
Self::InteriorNul(usize) => write!(f, "interior null character at index {usize}"),
9090
Self::NotNulTerminated => write!(f, "not null-terminated"),
9191
Self::BufferTooSmall => write!(f, "buffer too small"),
9292
}
@@ -112,8 +112,8 @@ pub enum FromStrWithBufError {
112112
impl Display for FromStrWithBufError {
113113
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
114114
match self {
115-
Self::InvalidChar(usize) => write!(f, "invalid character at index {}", usize),
116-
Self::InteriorNul(usize) => write!(f, "interior null character at index {}", usize),
115+
Self::InvalidChar(usize) => write!(f, "invalid character at index {usize}"),
116+
Self::InteriorNul(usize) => write!(f, "interior null character at index {usize}"),
117117
Self::BufferTooSmall => write!(f, "buffer too small"),
118118
}
119119
}

uefi/src/proto/driver/component_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub enum LanguageError {
246246
impl Display for LanguageError {
247247
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
248248
match self {
249-
Self::Ascii { index } => write!(f, "invalid character at index: {}", index),
249+
Self::Ascii { index } => write!(f, "invalid character at index: {index}"),
250250
}
251251
}
252252
}

uefi/src/proto/media/file/info.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ impl Display for FileInfoCreationError {
132132
match self {
133133
Self::InsufficientStorage(bytes) => write!(
134134
f,
135-
"provided buffer was too small. need at least {} bytes",
136-
bytes
135+
"provided buffer was too small. need at least {bytes} bytes"
137136
),
138137
}
139138
}

0 commit comments

Comments
 (0)