Skip to content

Commit

Permalink
Fix clippy warnings (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 authored Feb 12, 2021
1 parent 0e66671 commit e918c57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/preproc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub fn fix_includes<S: ::std::hash::BuildHasher>(
for p in paths.iter() {
eprintln!(" - {:?}", p);
}
eprintln!("");
eprintln!();

scc_map.insert(replacement, paths);
}
Expand Down
6 changes: 3 additions & 3 deletions src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub(crate) fn remove_blank_lines(data: &mut Vec<u8>) {
}
}

pub(crate) fn normalize_path<P: AsRef<Path>>(path: P) -> Option<PathBuf> {
pub(crate) fn normalize_path<P: AsRef<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() {
Expand All @@ -263,7 +263,7 @@ pub(crate) fn normalize_path<P: AsRef<Path>>(path: P) -> Option<PathBuf> {
}
}
}
Some(ret)
ret
}

pub(crate) fn get_paths_dist(path1: &PathBuf, path2: &PathBuf) -> Option<usize> {
Expand All @@ -288,7 +288,7 @@ pub(crate) fn guess_file<S: ::std::hash::BuildHasher>(
} 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 {
Expand Down

0 comments on commit e918c57

Please sign in to comment.