Skip to content

Commit 8e9fc52

Browse files
Merge pull request #471 from matthiasbeyer/clippy-exact-toolchains
Clippy exact toolchains
2 parents d7c1656 + d8697a8 commit 8e9fc52

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

.github/workflows/msrv.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
matrix:
9797
rust:
9898
- 1.66.0
99-
- stable
99+
- 1.73.0
100100
steps:
101101
- name: Checkout sources
102102
uses: actions/[email protected]
@@ -118,7 +118,7 @@ jobs:
118118
matrix:
119119
rust:
120120
- 1.66.0
121-
- stable
121+
- 1.73.0
122122

123123
steps:
124124
- name: Checkout sources

examples/async_source/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<F: Format + Send + Sync + Debug> AsyncSource for HttpSource<F> {
6868
.and_then(|text| {
6969
self.format
7070
.parse(Some(&self.uri), &text)
71-
.map_err(|e| ConfigError::Foreign(e))
71+
.map_err(ConfigError::Foreign)
7272
})
7373
}
7474
}

src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl ConfigBuilder<DefaultState> {
225225
.state
226226
.sources
227227
.into_iter()
228-
.map(|s| SourceType::Sync(s))
228+
.map(SourceType::Sync)
229229
.collect(),
230230
},
231231
defaults: self.defaults,

src/file/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ where
128128
let (uri, contents, format) = match self
129129
.source
130130
.resolve(self.format.clone())
131-
.map_err(|err| ConfigError::Foreign(err))
131+
.map_err(ConfigError::Foreign)
132132
{
133133
Ok(result) => (result.uri, result.content, result.format),
134134

src/value.rs

+16-9
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ where
152152

153153
impl Display for ValueKind {
154154
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
155+
use std::fmt::Write;
156+
155157
match *self {
156158
Self::String(ref value) => write!(f, "{}", value),
157159
Self::Boolean(value) => write!(f, "{}", value),
@@ -161,15 +163,20 @@ impl Display for ValueKind {
161163
Self::U128(value) => write!(f, "{}", value),
162164
Self::Float(value) => write!(f, "{}", value),
163165
Self::Nil => write!(f, "nil"),
164-
Self::Table(ref table) => write!(f, "{{ {} }}", {
165-
table
166-
.iter()
167-
.map(|(k, v)| format!("{} => {}, ", k, v))
168-
.collect::<String>()
169-
}),
170-
Self::Array(ref array) => write!(f, "{:?}", {
171-
array.iter().map(|e| format!("{}, ", e)).collect::<String>()
172-
}),
166+
Self::Table(ref table) => {
167+
let mut s = String::new();
168+
for (k, v) in table.iter() {
169+
write!(s, "{} => {}, ", k, v)?
170+
}
171+
write!(f, "{{ {s} }}")
172+
}
173+
Self::Array(ref array) => {
174+
let mut s = String::new();
175+
for e in array.iter() {
176+
write!(s, "{}, ", e)?;
177+
}
178+
write!(f, "{s:?}")
179+
}
173180
}
174181
}
175182
}

tests/async_builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl AsyncSource for AsyncFile {
3131

3232
self.format
3333
.parse(Some(&self.path), &text)
34-
.map_err(|e| ConfigError::Foreign(e))
34+
.map_err(ConfigError::Foreign)
3535
}
3636
}
3737

0 commit comments

Comments
 (0)