Skip to content

Commit

Permalink
fix cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
baoyachi committed Oct 27, 2021
1 parent 6e3542f commit fb59d34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ pub fn quick_log_level<S: Into<String>>(level: S, path: Option<S>) -> SimpleResu
let level = level.into();
log_level::validate_log_level(&level)?;
let mut config = LogConfig {
path: path.map(|x| x.into()).unwrap_or("".into()),
path: path.map(|x| x.into()).unwrap_or_else(|| "".into()),
level,
..Default::default()
};
Expand Down Expand Up @@ -594,7 +594,7 @@ fn encoder(time_format: Option<&String>) -> PatternEncoder {
DEFAULT_DATE_TIME_FORMAT.to_string()
};
let mut pattern = format!("{{d({})}} ", time_format);
pattern = pattern + "[{l}] <{M}:{L}>:{m}\n";
pattern += "[{l}] <{M}:{L}>:{m}\n";
PatternEncoder::new(pattern.as_str())
}

Expand Down
2 changes: 1 addition & 1 deletion src/out_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{de, Deserialize, Deserializer, Serialize};

macro_rules! de_from {
($err:expr) => {
KindSerde::deserialize($err).map_err(|x| de::Error::custom(x))
KindSerde::deserialize($err).map_err(de::Error::custom)
};
}

Expand Down

0 comments on commit fb59d34

Please sign in to comment.