From 87e5bf56753416bddb36b2cf21bd6840ea1a1a28 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Fri, 12 Feb 2021 11:30:06 +0100 Subject: [PATCH] Fix clippy warnings --- src/preproc.rs | 2 +- src/tools.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/preproc.rs b/src/preproc.rs index 939997713..5e8791382 100644 --- a/src/preproc.rs +++ b/src/preproc.rs @@ -147,7 +147,7 @@ pub fn fix_includes( for p in paths.iter() { eprintln!(" - {:?}", p); } - eprintln!(""); + eprintln!(); scc_map.insert(replacement, paths); } diff --git a/src/tools.rs b/src/tools.rs index e1e1cc2f5..a8ae9b537 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -238,7 +238,7 @@ pub(crate) fn remove_blank_lines(data: &mut Vec) { } } -pub(crate) fn normalize_path>(path: P) -> Option { +pub(crate) fn normalize_path>(path: P) -> PathBuf { // Copied from Cargo sources: https://github.com/rust-lang/cargo/blob/master/src/cargo/util/paths.rs#L65 let mut components = path.as_ref().components().peekable(); let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() { @@ -263,7 +263,7 @@ pub(crate) fn normalize_path>(path: P) -> Option { } } } - Some(ret) + ret } pub(crate) fn get_paths_dist(path1: &PathBuf, path2: &PathBuf) -> Option { @@ -288,7 +288,7 @@ pub(crate) fn guess_file( } else { include_path }; - let include_path = normalize_path(include_path).unwrap(); + let include_path = normalize_path(include_path); if let Some(possibilities) = all_files.get(include_path.file_name().unwrap().to_str().unwrap()) { if possibilities.len() == 1 {