File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ impl CachedPath {
9999 cache : & Cache < Fs > ,
100100 ctx : & mut Ctx ,
101101 ) -> Option < Self > {
102- let cached_path = cache . value ( & self . path . join ( module_name) ) ;
102+ let cached_path = self . push ( module_name, cache ) ;
103103 cache. is_dir ( & cached_path, ctx) . then_some ( cached_path)
104104 }
105105
@@ -122,12 +122,21 @@ impl CachedPath {
122122 } )
123123 }
124124
125- pub ( crate ) fn add_extension < Fs : FileSystem > ( & self , ext : & str , cache : & Cache < Fs > ) -> Self {
125+ pub ( crate ) fn push < Fs : FileSystem > ( & self , target : & str , cache : & Cache < Fs > ) -> Self {
126+ SCRATCH_PATH . with_borrow_mut ( |path| {
127+ path. clear ( ) ;
128+ path. push ( & self . path ) ;
129+ path. push ( target) ;
130+ cache. value ( path)
131+ } )
132+ }
133+
134+ pub ( crate ) fn add_extension < Fs : FileSystem > ( & self , target : & str , cache : & Cache < Fs > ) -> Self {
126135 SCRATCH_PATH . with_borrow_mut ( |path| {
127136 path. clear ( ) ;
128137 let s = path. as_mut_os_string ( ) ;
129138 s. push ( self . path . as_os_str ( ) ) ;
130- s. push ( ext ) ;
139+ s. push ( target ) ;
131140 cache. value ( path)
132141 } )
133142 }
You can’t perform that action at this time.
0 commit comments