avoid some clippy warnings
This commit is contained in:
@ -54,15 +54,15 @@ impl <E: RpcEnvironment + Clone> H2Service<E> {
|
||||
match self.router.find_method(&components, method, &mut uri_param) {
|
||||
MethodDefinition::None => {
|
||||
let err = http_err!(NOT_FOUND, "Path not found.".to_string());
|
||||
return Box::new(future::ok((formatter.format_error)(err)));
|
||||
Box::new(future::ok((formatter.format_error)(err)))
|
||||
}
|
||||
MethodDefinition::Simple(api_method) => {
|
||||
return crate::server::rest::handle_sync_api_request(
|
||||
self.rpcenv.clone(), api_method, formatter, parts, body, uri_param);
|
||||
crate::server::rest::handle_sync_api_request(
|
||||
self.rpcenv.clone(), api_method, formatter, parts, body, uri_param)
|
||||
}
|
||||
MethodDefinition::Async(async_method) => {
|
||||
return crate::server::rest::handle_async_api_request(
|
||||
self.rpcenv.clone(), async_method, formatter, parts, body, uri_param);
|
||||
crate::server::rest::handle_async_api_request(
|
||||
self.rpcenv.clone(), async_method, formatter, parts, body, uri_param)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ fn handle_static_file_download(filename: PathBuf) -> BoxFut {
|
||||
}
|
||||
});
|
||||
|
||||
return Box::new(response);
|
||||
Box::new(response)
|
||||
}
|
||||
|
||||
fn extract_auth_data(headers: &http::HeaderMap) -> (Option<String>, Option<String>) {
|
||||
|
@ -95,7 +95,7 @@ impl std::str::FromStr for UPID {
|
||||
|
||||
if let Some(cap) = REGEX.captures(s) {
|
||||
|
||||
return Ok(UPID {
|
||||
Ok(UPID {
|
||||
pid: i32::from_str_radix(&cap["pid"], 16).unwrap(),
|
||||
pstart: u64::from_str_radix(&cap["pstart"], 16).unwrap(),
|
||||
starttime: i64::from_str_radix(&cap["starttime"], 16).unwrap(),
|
||||
@ -104,7 +104,7 @@ impl std::str::FromStr for UPID {
|
||||
worker_id: if cap["wid"].is_empty() { None } else { Some(cap["wid"].to_string()) },
|
||||
username: cap["username"].to_string(),
|
||||
node: cap["node"].to_string(),
|
||||
});
|
||||
})
|
||||
} else {
|
||||
bail!("unable to parse UPID '{}'", s);
|
||||
}
|
||||
|
Reference in New Issue
Block a user