Skip to content

Commit f4448a1

Browse files
authored
fix new clippy lints (#1776)
Came with rust 1.85.0
1 parent b1001e9 commit f4448a1

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

runtimes/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ impl Hosted {
661661

662662
impl FromIterator<String> for Hosted {
663663
fn from_iter<I: IntoIterator<Item = String>>(iter: I) -> Self {
664-
Self(iter.into_iter().map(Into::into).collect())
664+
Self(iter.into_iter().collect())
665665
}
666666
}
667667

runtimes/core/src/log/consolewriter.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,14 @@ impl<W: Write + Sync + Send + 'static> Writer for ConsoleWriter<W> {
137137

138138
self.write_fields(&mut buf, values)?;
139139

140-
buf.write_all(b"\n")
141-
.map_err(std::io::Error::from)
142-
.context("new line")?;
140+
buf.write_all(b"\n").context("new line")?;
143141

144142
match self.mu.lock() {
145143
Ok(guard) => {
146144
let mut w = guard
147145
.try_borrow_mut()
148146
.context("unable to borrow console output")?;
149-
w.write_all(&buf)
150-
.map_err(std::io::Error::from)
151-
.context("write")?;
147+
w.write_all(&buf).context("write")?;
152148
Ok(())
153149
}
154150
Err(poisoned) => Err(anyhow::anyhow!("poisoned mutex: {:?}", poisoned)),

runtimes/core/src/log/writers.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,12 @@ impl<W: Write + Sync + Send + 'static> Writer for BlockingWriter<W> {
8080
serde_json::to_writer(&mut buf, values)
8181
.map_err(std::io::Error::from)
8282
.context("serde_writer")?;
83-
buf.write_all(b"\n")
84-
.map_err(std::io::Error::from)
85-
.context("new line")?;
83+
buf.write_all(b"\n").context("new line")?;
8684

8785
match self.mu.lock() {
8886
Ok(guard) => {
8987
let mut w = guard.try_borrow_mut().context("unable to borrow")?;
90-
w.write_all(&buf)
91-
.map_err(std::io::Error::from)
92-
.context("write")?;
88+
w.write_all(&buf).context("write")?;
9389
Ok(())
9490
}
9591
Err(poisoned) => Err(anyhow::anyhow!("poisoned mutex: {:?}", poisoned)),
@@ -121,9 +117,7 @@ impl<W: AsyncWrite + Sync + Send + 'static> Writer for AsyncWriter<W> {
121117
serde_json::to_writer(&mut buf, values)
122118
.map_err(std::io::Error::from)
123119
.context("serde_writer")?;
124-
buf.write_all(b"\n")
125-
.map_err(std::io::Error::from)
126-
.context("new line")?;
120+
buf.write_all(b"\n").context("new line")?;
127121

128122
let mu = self.mu.clone();
129123
tokio::spawn(async move {

0 commit comments

Comments
 (0)