misc clippy fixes
the trivial ones ;) Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
645b2ae89b
commit
bb7018e183
@ -80,7 +80,7 @@ lazy_static! {
|
||||
#[api]
|
||||
/// Lists all current items
|
||||
fn list_items() -> Result<Vec<String>, Error> {
|
||||
Ok(ITEM_MAP.lock().unwrap().keys().map(|k| k.clone()).collect())
|
||||
Ok(ITEM_MAP.lock().unwrap().keys().cloned().collect())
|
||||
}
|
||||
|
||||
#[api(
|
||||
|
@ -206,7 +206,7 @@ impl ApiConfig {
|
||||
|
||||
let logger_options = FileLogOptions {
|
||||
append: true,
|
||||
file_opts: file_opts.unwrap_or(CreateOptions::default()),
|
||||
file_opts: file_opts.unwrap_or_default(),
|
||||
..Default::default()
|
||||
};
|
||||
let request_log = Arc::new(Mutex::new(FileLogger::new(&path, logger_options)?));
|
||||
@ -246,7 +246,7 @@ impl ApiConfig {
|
||||
let logger_options = FileLogOptions {
|
||||
append: true,
|
||||
prefix_time: true,
|
||||
file_opts: file_opts.unwrap_or(CreateOptions::default()),
|
||||
file_opts: file_opts.unwrap_or_default(),
|
||||
..Default::default()
|
||||
};
|
||||
let auth_log = Arc::new(Mutex::new(FileLogger::new(&path, logger_options)?));
|
||||
|
@ -205,7 +205,7 @@ pub fn extract_cookie(cookie: &str, cookie_name: &str) -> Option<String> {
|
||||
/// We assume cookie_name is already url encoded.
|
||||
pub fn cookie_from_header(headers: &http::HeaderMap, cookie_name: &str) -> Option<String> {
|
||||
if let Some(Ok(cookie)) = headers.get("COOKIE").map(|v| v.to_str()) {
|
||||
extract_cookie(&cookie, cookie_name)
|
||||
extract_cookie(cookie, cookie_name)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ async fn get_request_parameters<S: 'static + BuildHasher + Send>(
|
||||
}
|
||||
}
|
||||
param_schema.verify_json(¶ms)?;
|
||||
return Ok(params);
|
||||
Ok(params)
|
||||
} else {
|
||||
parse_query_parameters(param_schema, utf8_data, &parts, &uri_param)
|
||||
}
|
||||
|
@ -901,7 +901,7 @@ impl WorkerTask {
|
||||
pub fn request_abort(&self) {
|
||||
let prev_abort = self.abort_requested.swap(true, Ordering::SeqCst);
|
||||
if !prev_abort { // log abort one time
|
||||
self.log_message(format!("received abort request ..."));
|
||||
self.log_message("received abort request ...".to_string());
|
||||
}
|
||||
// noitify listeners
|
||||
let mut data = self.data.lock().unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user