clippy lints

This commit is contained in:
Edward Shen 2021-07-09 17:20:15 -04:00
parent b4f27c5f8c
commit a8e5d09ff0
Signed by: edward
GPG key ID: 19182661E818369F
2 changed files with 4 additions and 5 deletions

View file

@ -27,9 +27,8 @@ pub fn load_config() -> Result<Config, serde_yaml::Error> {
let config_file: Result<YamlArgs, _> = { let config_file: Result<YamlArgs, _> = {
let config_path = cli_args let config_path = cli_args
.config_path .config_path
.as_ref() .as_deref()
.map(PathBuf::as_path) .unwrap_or_else(|| Path::new("./settings.yaml"));
.unwrap_or(Path::new("./settings.yaml"));
match File::open(config_path) { match File::open(config_path) {
Ok(file) => serde_yaml::from_reader(file), Ok(file) => serde_yaml::from_reader(file),
Err(e) if e.kind() == ErrorKind::NotFound => { Err(e) if e.kind() == ErrorKind::NotFound => {
@ -138,7 +137,7 @@ struct YamlExtendedOptions {
logging_level: LevelFilter, logging_level: LevelFilter,
} }
fn default_logging_level() -> LevelFilter { const fn default_logging_level() -> LevelFilter {
LevelFilter::Info LevelFilter::Info
} }

View file

@ -26,7 +26,7 @@ impl Display for Port {
pub struct Mebibytes(usize); pub struct Mebibytes(usize);
impl Mebibytes { impl Mebibytes {
pub const fn get(&self) -> usize { pub const fn get(self) -> usize {
self.0 self.0
} }
} }