diff --git a/.cargo/config.toml b/.cargo/config.toml index 69564e33..8b1c087f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,6 +4,7 @@ rustflags = [ # do not change or add/remove here, but one can add exceptions after this section # for more info see: "-Dunsafe_code", + "-Wunexpected_cfgs", "-Wclippy::all", "-Wclippy::await_holding_lock", "-Wclippy::char_lit_as_u8", @@ -44,7 +45,6 @@ rustflags = [ "-Wclippy::match_wild_err_arm", "-Wclippy::match_wildcard_for_single_variants", "-Wclippy::mem_forget", - "-Wclippy::mismatched_target_os", "-Wclippy::missing_enforced_import_renames", "-Wclippy::mut_mut", "-Wclippy::mutex_integer", diff --git a/src/licenses/gather.rs b/src/licenses/gather.rs index 81f3016c..4aa85dfc 100644 --- a/src/licenses/gather.rs +++ b/src/licenses/gather.rs @@ -80,7 +80,7 @@ fn get_file_source(root: &Path, path: PathBuf) -> PackFile { break; } - let keep = std::cmp::max(s.trim_end_matches(|p| p == '\r' || p == '\n').len(), min); + let keep = std::cmp::max(s.trim_end_matches(['\r', '\n']).len(), min); s.truncate(keep); s.push('\n');