Skip to content

Commit e9d5224

Browse files
committed
chore(all): clippy fix
1 parent d766e5a commit e9d5224

File tree

9 files changed

+26
-27
lines changed

9 files changed

+26
-27
lines changed

msg-sim/src/dummynet.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Pipe {
5252
cmd.arg("dnctl").arg("pipe").arg(self.id.to_string()).arg("config");
5353

5454
if let Some(bandwidth) = self.bandwidth {
55-
let bw = format!("{}Kbit/s", bandwidth);
55+
let bw = format!("{bandwidth}Kbit/s");
5656

5757
cmd.args(["bw", &bw]);
5858
}
@@ -236,7 +236,7 @@ impl PacketFilter {
236236
let endpoint = self.endpoint.expect("No endpoint set");
237237
let pipe_id = self.pipe.id();
238238

239-
let echo_command = format!("dummynet in from any to {} pipe {}", endpoint, pipe_id);
239+
let echo_command = format!("dummynet in from any to {endpoint} pipe {pipe_id}");
240240

241241
// Set up the echo command
242242
let mut echo = Command::new("echo").arg(echo_command).stdout(Stdio::piped()).spawn()?;

msg-socket/src/rep/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ mod tests {
146146
async fn reqrep_durable() {
147147
let _ = tracing_subscriber::fmt::try_init();
148148
let random_port = rand::random::<u16>() + 10000;
149-
let addr = format!("0.0.0.0:{}", random_port);
149+
let addr = format!("0.0.0.0:{random_port}");
150150

151151
// Initialize the request socket (client side) with a transport
152152
let mut req = ReqSocket::new(Tcp::default());

msg-transport/src/ipc/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ impl Transport<PathBuf> for Ipc {
110110
debug!("Socket file already exists. Attempting to remove.");
111111
if let Err(e) = std::fs::remove_file(&addr) {
112112
return Err(io::Error::other(format!(
113-
"Failed to remove existing socket file, {:?}",
114-
e
113+
"Failed to remove existing socket file, {e:?}"
115114
)));
116115
}
117116
}

msg-wire/src/compression/lz4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct Lz4Decompressor;
2626
impl Decompressor for Lz4Decompressor {
2727
fn decompress(&self, data: &[u8]) -> Result<Bytes, io::Error> {
2828
let bytes = decompress_size_prepended(data).map_err(|e| {
29-
io::Error::new(io::ErrorKind::InvalidData, format!("Lz4 decompression failed: {}", e))
29+
io::Error::new(io::ErrorKind::InvalidData, format!("Lz4 decompression failed: {e}"))
3030
})?;
3131

3232
Ok(Bytes::from(bytes))

msg-wire/src/compression/mod.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,37 +173,37 @@ mod tests {
173173

174174
let gzip = GzipCompressor::new(6);
175175
let (gzip_time, gzip_perf, gzip_comp) = compression_test(&data, gzip);
176-
println!("gzip compression shrank the data by {:.2}% in {:?}", gzip_perf, gzip_time);
176+
println!("gzip compression shrank the data by {gzip_perf:.2}% in {gzip_time:?}");
177177

178178
let zstd = ZstdCompressor::new(6);
179179
let (zstd_time, zstd_perf, zstd_comp) = compression_test(&data, zstd);
180-
println!("zstd compression shrank the data by {:.2}% in {:?}", zstd_perf, zstd_time);
180+
println!("zstd compression shrank the data by {zstd_perf:.2}% in {zstd_time:?}");
181181

182182
let snappy = SnappyCompressor;
183183
let (snappy_time, snappy_perf, snappy_comp) = compression_test(&data, snappy);
184-
println!("snappy compression shrank the data by {:.2}% in {:?}", snappy_perf, snappy_time);
184+
println!("snappy compression shrank the data by {snappy_perf:.2}% in {snappy_time:?}");
185185

186186
let lz4 = Lz4Compressor;
187187
let (lz4_time, lz4_perf, lz4_comp) = compression_test(&data, lz4);
188-
println!("lz4 compression shrank the data by {:.2}% in {:?}", lz4_perf, lz4_time);
188+
println!("lz4 compression shrank the data by {lz4_perf:.2}% in {lz4_time:?}");
189189

190190
println!("------ SSZ BLOCK -------");
191191

192192
let gzip = GzipDecompressor;
193193
let gzip_time = decompression_test(&gzip_comp, gzip);
194-
println!("gzip decompression took {:?}", gzip_time);
194+
println!("gzip decompression took {gzip_time:?}");
195195

196196
let zstd = ZstdDecompressor;
197197
let zstd_time = decompression_test(&zstd_comp, zstd);
198-
println!("zstd decompression took {:?}", zstd_time);
198+
println!("zstd decompression took {zstd_time:?}");
199199

200200
let snappy = SnappyDecompressor;
201201
let snappy_time = decompression_test(&snappy_comp, snappy);
202-
println!("snappy decompression took {:?}", snappy_time);
202+
println!("snappy decompression took {snappy_time:?}");
203203

204204
let lz4 = Lz4Decompressor;
205205
let lz4_time = decompression_test(&lz4_comp, lz4);
206-
println!("lz4 decompression took {:?}", lz4_time);
206+
println!("lz4 decompression took {lz4_time:?}");
207207
}
208208

209209
#[test]
@@ -216,36 +216,36 @@ mod tests {
216216

217217
let gzip = GzipCompressor::new(6);
218218
let (gzip_time, gzip_perf, gzip_comp) = compression_test(&data, gzip);
219-
println!("gzip compression shrank the data by {:.2}% in {:?}", gzip_perf, gzip_time);
219+
println!("gzip compression shrank the data by {gzip_perf:.2}% in {gzip_time:?}");
220220

221221
let zstd = ZstdCompressor::new(6);
222222
let (zstd_time, zstd_perf, zstd_comp) = compression_test(&data, zstd);
223-
println!("zstd compression shrank the data by {:.2}% in {:?}", zstd_perf, zstd_time);
223+
println!("zstd compression shrank the data by {zstd_perf:.2}% in {zstd_time:?}");
224224

225225
let snappy = SnappyCompressor;
226226
let (snappy_time, snappy_perf, snappy_comp) = compression_test(&data, snappy);
227-
println!("snappy compression shrank the data by {:.2}% in {:?}", snappy_perf, snappy_time);
227+
println!("snappy compression shrank the data by {snappy_perf:.2}% in {snappy_time:?}");
228228

229229
let lz4 = Lz4Compressor;
230230
let (lz4_time, lz4_perf, lz4_comp) = compression_test(&data, lz4);
231-
println!("lz4 compression shrank the data by {:.2}% in {:?}", lz4_perf, lz4_time);
231+
println!("lz4 compression shrank the data by {lz4_perf:.2}% in {lz4_time:?}");
232232

233233
println!("------ BLOB TX ------");
234234

235235
let gzip = GzipDecompressor;
236236
let gzip_time = decompression_test(&gzip_comp, gzip);
237-
println!("gzip decompression took {:?}", gzip_time);
237+
println!("gzip decompression took {gzip_time:?}");
238238

239239
let zstd = ZstdDecompressor;
240240
let zstd_time = decompression_test(&zstd_comp, zstd);
241-
println!("zstd decompression took {:?}", zstd_time);
241+
println!("zstd decompression took {zstd_time:?}");
242242

243243
let snappy = SnappyDecompressor;
244244
let snappy_time = decompression_test(&snappy_comp, snappy);
245-
println!("snappy decompression took {:?}", snappy_time);
245+
println!("snappy decompression took {snappy_time:?}");
246246

247247
let lz4 = Lz4Decompressor;
248248
let lz4_time = decompression_test(&lz4_comp, lz4);
249-
println!("lz4 decompression took {:?}", lz4_time);
249+
println!("lz4 decompression took {lz4_time:?}");
250250
}
251251
}

msg/examples/ipc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async fn main() {
3131
});
3232

3333
let res: Bytes = req.request(Bytes::from("helloooo!")).await.unwrap();
34-
println!("Response: {:?}", res);
34+
println!("Response: {res:?}");
3535

3636
// Access the socket statistics
3737
let stats = req.stats();

msg/examples/reqrep.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async fn main() {
2323
});
2424

2525
let res: Bytes = req.request(Bytes::from("helloooo!")).await.unwrap();
26-
println!("Response: {:?}", res);
26+
println!("Response: {res:?}");
2727

2828
// Access the socket statistics
2929
let stats = req.stats();

msg/examples/reqrep_auth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct Auth;
99

1010
impl Authenticator for Auth {
1111
fn authenticate(&self, id: &Bytes) -> bool {
12-
println!("Auth request from: {:?}", id);
12+
println!("Auth request from: {id:?}");
1313
// Custom authentication logic
1414
true
1515
}
@@ -41,5 +41,5 @@ async fn main() {
4141
});
4242

4343
let res: Bytes = req.request(Bytes::from("hello")).await.unwrap();
44-
println!("Response: {:?}", res);
44+
println!("Response: {res:?}");
4545
}

msg/examples/reqrep_compression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ async fn main() {
3636
});
3737

3838
let res: Bytes = req.request(Bytes::from("hello")).await.unwrap();
39-
println!("Response: {:?}", res);
39+
println!("Response: {res:?}");
4040
}

0 commit comments

Comments
 (0)