chore: Apply clippy suggestions

chore/clippy
FabianLars 2 days ago
parent 27ddcd0abe
commit 14381190e7
No known key found for this signature in database

@ -14,11 +14,11 @@ pub struct RequestBody {
#[command]
pub fn log_operation(event: String, payload: Option<String>) {
log::info!("{} {:?}", event, payload);
log::info!("{event} {payload:?}");
}
#[command]
pub fn perform_request(endpoint: String, body: RequestBody) -> String {
println!("{} {:?}", endpoint, body);
println!("{endpoint} {body:?}");
"message response".into()
}

@ -95,7 +95,7 @@ pub fn run() {
let server = match tiny_http::Server::http("localhost:3003") {
Ok(s) => s,
Err(e) => {
eprintln!("{}", e);
eprintln!("{e}");
std::process::exit(1);
}
};

@ -30,7 +30,7 @@ fn set_cookies(
fn cookies(cookie_store: &CookieStore, url: &url::Url) -> Option<HeaderValue> {
let s = cookie_store
.get_request_values(url)
.map(|(name, value)| format!("{}={}", name, value))
.map(|(name, value)| format!("{name}={value}"))
.collect::<Vec<_>>()
.join("; ");

@ -52,7 +52,7 @@ impl<'de> Deserialize<'de> for Entry {
};
Ok(Entry {
url: parse_url_pattern(&url).map_err(|e| {
serde::de::Error::custom(format!("`{}` is not a valid URL pattern: {e}", url))
serde::de::Error::custom(format!("`{url}` is not a valid URL pattern: {e}"))
})?,
})
})

@ -29,7 +29,7 @@ async fn accept_connection(stream: TcpStream) {
let (write, read) = ws_stream.split();
if let Err(e) = read.forward(write).await {
eprintln!("Error: {}", e);
eprintln!("Error: {e}");
}
}

Loading…
Cancel
Save