Skip to content

Commit 07190cf

Browse files
committed
fix: clippy issues
1 parent 6532303 commit 07190cf

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/http-server/src/handler/file_explorer/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl FileExplorer {
104104
}
105105
},
106106
Err(err) => {
107-
let message = format!("Failed to resolve path: {}", err);
107+
let message = format!("Failed to resolve path: {err}");
108108
Ok(Response::new(Full::new(Bytes::from(message))))
109109
}
110110
},
@@ -138,7 +138,7 @@ impl FileExplorer {
138138
if let Err(err) = self.process_multipart(body, boundary.unwrap()).await {
139139
return Ok(Response::builder()
140140
.status(StatusCode::INTERNAL_SERVER_ERROR)
141-
.body(Full::from(format!("INTERNAL SERVER ERROR: {}", err)))
141+
.body(Full::from(format!("INTERNAL SERVER ERROR: {err}")))
142142
.unwrap());
143143
}
144144

@@ -165,8 +165,7 @@ impl FileExplorer {
165165
let mut file = tokio::fs::File::create(file_name).await.unwrap();
166166

167167
println!(
168-
"\n\nName: {:?}, FileName: {:?}, Content-Type: {:?}\n\n",
169-
name, file_name, content_type
168+
"\n\nName: {name:?}, FileName: {file_name:?}, Content-Type: {content_type:?}\n\n"
170169
);
171170

172171
// Process the field data chunks e.g. store them in a file.
@@ -177,7 +176,7 @@ impl FileExplorer {
177176
file.write_all(&field_chunk).await.unwrap();
178177
}
179178

180-
println!("Field Bytes Length: {:?}", field_bytes_len);
179+
println!("Field Bytes Length: {field_bytes_len:?}");
181180
}
182181

183182
Ok(())

src/http-server/src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl Server {
3636
let addr = SocketAddr::from((self.config.host, self.config.port));
3737
let listener = TcpListener::bind(addr).await?;
3838

39-
println!("Listening on http://{}", addr);
39+
println!("Listening on http://{addr}");
4040

4141
if matches!(addr.ip(), IpAddr::V4(ALL_INTERFACES_IPV4)) {
4242
if let Ok(local_ip) = local_ip() {
@@ -71,7 +71,7 @@ impl Server {
7171
let svc = TowerToHyperService::new(svc);
7272

7373
if let Err(err) = http1::Builder::new().serve_connection(io, svc).await {
74-
eprintln!("server error: {}", err);
74+
eprintln!("server error: {err}");
7575
}
7676
});
7777
}

0 commit comments

Comments
 (0)