chore: code cleanup
https://rust-lang.github.io/rust-clippy/master/index.html#op_ref https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
This commit is contained in:
parent
7b98741163
commit
c86313d4fa
15 changed files with 56 additions and 92 deletions
12
src/main.rs
12
src/main.rs
|
@ -68,10 +68,7 @@ async fn main() {
|
|||
let config = match raw_config.extract::<Config>() {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
"It looks like your config is invalid. The following error occurred: {}",
|
||||
e
|
||||
);
|
||||
eprintln!("It looks like your config is invalid. The following error occurred: {e}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
|
@ -91,8 +88,7 @@ async fn main() {
|
|||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
"It looks like your log config is invalid. The following error occurred: {}",
|
||||
e
|
||||
"It looks like your log config is invalid. The following error occurred: {e}"
|
||||
);
|
||||
EnvFilter::try_new("warn").unwrap()
|
||||
}
|
||||
|
@ -118,7 +114,7 @@ async fn main() {
|
|||
let filter_layer = match EnvFilter::try_new(&config.log) {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
eprintln!("It looks like your config is invalid. The following error occured while parsing it: {}", e);
|
||||
eprintln!("It looks like your config is invalid. The following error occured while parsing it: {e}");
|
||||
EnvFilter::try_new("warn").unwrap()
|
||||
}
|
||||
};
|
||||
|
@ -534,6 +530,6 @@ fn method_to_filter(method: Method) -> MethodFilter {
|
|||
Method::POST => MethodFilter::POST,
|
||||
Method::PUT => MethodFilter::PUT,
|
||||
Method::TRACE => MethodFilter::TRACE,
|
||||
m => panic!("Unsupported HTTP method: {:?}", m),
|
||||
m => panic!("Unsupported HTTP method: {m:?}"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue