Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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