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_path = cli_args
.config_path
.as_ref()
.map(PathBuf::as_path)
.unwrap_or(Path::new("./settings.yaml"));
.as_deref()
.unwrap_or_else(|| Path::new("./settings.yaml"));
match File::open(config_path) {
Ok(file) => serde_yaml::from_reader(file),
Err(e) if e.kind() == ErrorKind::NotFound => {
@ -138,7 +137,7 @@ struct YamlExtendedOptions {
logging_level: LevelFilter,
}
fn default_logging_level() -> LevelFilter {
const fn default_logging_level() -> LevelFilter {
LevelFilter::Info
}

View file

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