chore: Apply clippy suggestions

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

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

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

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

@ -52,7 +52,7 @@ impl<'de> Deserialize<'de> for Entry {
}; };
Ok(Entry { Ok(Entry {
url: parse_url_pattern(&url).map_err(|e| { 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(); let (write, read) = ws_stream.split();
if let Err(e) = read.forward(write).await { if let Err(e) = read.forward(write).await {
eprintln!("Error: {}", e); eprintln!("Error: {e}");
} }
} }

Loading…
Cancel
Save