From 5ebb4017030c065c31d52be50dc7fa7a4c128d64 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 25 Mar 2021 11:13:37 +1100 Subject: feat(lsp): add import completions (#9821) --- core/normalize_path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/normalize_path.rs') diff --git a/core/normalize_path.rs b/core/normalize_path.rs index 6099696ec..4ae41bbdf 100644 --- a/core/normalize_path.rs +++ b/core/normalize_path.rs @@ -9,8 +9,8 @@ use std::path::PathBuf; /// /// Taken from Cargo /// https://github.com/rust-lang/cargo/blob/af307a38c20a753ec60f0ad18be5abed3db3c9ac/src/cargo/util/paths.rs#L60-L85 -pub fn normalize_path(path: &Path) -> PathBuf { - let mut components = path.components().peekable(); +pub fn normalize_path>(path: P) -> PathBuf { + let mut components = path.as_ref().components().peekable(); let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() { components.next(); -- cgit v1.2.3