File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
crates/oxc_diagnostics/src Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ fn from_file_path<A: AsRef<Path>>(path: A) -> Option<String> {
330330fn strict_canonicalize < P : AsRef < Path > > ( path : P ) -> std:: io:: Result < PathBuf > {
331331 use std:: io;
332332
333- fn impl_ ( path : PathBuf ) -> std:: io:: Result < PathBuf > {
333+ fn impl_ ( path : & Path ) -> std:: io:: Result < PathBuf > {
334334 let head = path. components ( ) . next ( ) . ok_or ( io:: Error :: other ( "empty path" ) ) ?;
335335 let disk_;
336336 let head = if let std:: path:: Component :: Prefix ( prefix) = head {
@@ -350,7 +350,7 @@ fn strict_canonicalize<P: AsRef<Path>>(path: P) -> std::io::Result<PathBuf> {
350350 }
351351
352352 let canon = std:: fs:: canonicalize ( path) ?;
353- impl_ ( canon)
353+ impl_ ( & canon)
354354}
355355
356356#[ cfg( test) ]
@@ -366,6 +366,9 @@ mod tests {
366366 #[ test]
367367 #[ cfg( windows) ]
368368 fn test_idempotent_canonicalization ( ) {
369+ use crate :: service:: strict_canonicalize;
370+ use std:: path:: Path ;
371+
369372 let lhs = strict_canonicalize ( Path :: new ( "." ) ) . unwrap ( ) ;
370373 let rhs = strict_canonicalize ( & lhs) . unwrap ( ) ;
371374 assert_eq ! ( lhs, rhs) ;
@@ -416,7 +419,7 @@ mod tests {
416419 ] ;
417420
418421 for ( path, expected) in paths. iter ( ) . zip ( expected) {
419- let uri = Uri :: from_file_path ( path) . unwrap ( ) ;
422+ let uri = from_file_path ( path) . unwrap ( ) ;
420423 assert_eq ! ( uri. to_string( ) , expected) ;
421424 }
422425 }
You can’t perform that action at this time.
0 commit comments