@@ -5,6 +5,7 @@ use std::{
55 hash:: { BuildHasherDefault , Hash , Hasher } ,
66 io,
77 ops:: Deref ,
8+ path:: PathBuf ,
89 sync:: Arc ,
910} ;
1011
@@ -26,7 +27,7 @@ use crate::{
2627pub struct Cache < Fs > {
2728 pub ( crate ) fs : Fs ,
2829 paths : DashSet < CachedPath , BuildHasherDefault < IdentityHasher > > ,
29- tsconfigs : DashMap < Utf8PathBuf , Arc < TsConfig > , BuildHasherDefault < FxHasher > > ,
30+ tsconfigs : DashMap < PathBuf , Arc < TsConfig > , BuildHasherDefault < FxHasher > > ,
3031}
3132
3233impl < Fs : Send + Sync + FileSystem > Cache < Fs > {
@@ -68,7 +69,7 @@ impl<Fs: Send + Sync + FileSystem> Cache<Fs> {
6869 F : FnOnce ( TsConfig ) -> Fut + Send ,
6970 Fut : Send + Future < Output = Result < TsConfig , ResolveError > > ,
7071 {
71- if let Some ( tsconfig_ref) = self . tsconfigs . get ( path) {
72+ if let Some ( tsconfig_ref) = self . tsconfigs . get ( path. as_std_path ( ) ) {
7273 return Ok ( Arc :: clone ( tsconfig_ref. value ( ) ) ) ;
7374 }
7475 let meta = self . fs . metadata ( path. as_std_path ( ) ) . await . ok ( ) ;
@@ -98,7 +99,7 @@ impl<Fs: Send + Sync + FileSystem> Cache<Fs> {
9899 let tsconfig = Arc :: new ( tsconfig. build ( ) ) ;
99100 self
100101 . tsconfigs
101- . insert ( path. to_path_buf ( ) , Arc :: clone ( & tsconfig) ) ;
102+ . insert ( path. as_std_path ( ) . to_path_buf ( ) , Arc :: clone ( & tsconfig) ) ;
102103 Ok ( tsconfig)
103104 }
104105}
0 commit comments