@@ -55,6 +55,7 @@ use std::collections::HashSet;
5555use std:: path:: PathBuf ;
5656
5757use aether_path:: FilePath ;
58+ use camino:: Utf8Path ;
5859use camino:: Utf8PathBuf ;
5960use oak_db:: Db ;
6061use oak_db:: DbInputs ;
@@ -191,7 +192,7 @@ impl ScanScheduler {
191192 . iter ( )
192193 . filter_map ( |path| {
193194 let path = FilePath :: from_path_buf ( path. clone ( ) ) ?;
194- let scan_path = path. as_file ( ) ? . as_path ( ) . to_path_buf ( ) ;
195+ let scan_path = path. as_path ( ) ? . to_path_buf ( ) ;
195196 Some ( ( scan_path, path) )
196197 } )
197198 . collect ( ) ;
@@ -264,7 +265,7 @@ impl ScanScheduler {
264265 // instead of applying surgically against a transient world.
265266 let mut description_roots: HashSet < Root > = HashSet :: new ( ) ;
266267 for event in & events {
267- let Some ( path) = event. path . as_file ( ) . map ( |f| f . as_path ( ) . to_path_buf ( ) ) else {
268+ let Some ( path) = event. path . as_path ( ) . map ( Utf8Path :: to_path_buf) else {
268269 continue ;
269270 } ;
270271 if path. file_name ( ) . is_some_and ( |name| name == "DESCRIPTION" ) {
@@ -285,7 +286,7 @@ impl ScanScheduler {
285286
286287 // Pass 2: R-file events.
287288 for event in events {
288- let Some ( path) = event. path . as_file ( ) . map ( |f| f . as_path ( ) . to_path_buf ( ) ) else {
289+ let Some ( path) = event. path . as_path ( ) . map ( Utf8Path :: to_path_buf) else {
289290 continue ;
290291 } ;
291292 if path. file_name ( ) . is_some_and ( |name| name == "DESCRIPTION" ) {
@@ -364,7 +365,7 @@ impl ScanScheduler {
364365 // would stay pending forever. On success the buffer rides along
365366 // and replays when the requeued scan finishes. On failure we
366367 // fall back to the idle drain.
367- let scan_path = root. path ( db) . as_file ( ) . map ( |f| f . as_path ( ) . to_path_buf ( ) ) ;
368+ let scan_path = root. path ( db) . as_path ( ) . map ( Utf8Path :: to_path_buf) ;
368369 match scan_path {
369370 Some ( path) => {
370371 self . state . insert ( root, ScanState :: Scanning ) ;
@@ -417,11 +418,11 @@ impl ScanScheduler {
417418 } ,
418419 Some ( ScanState :: ScanningWithRescanQueued ) => None ,
419420 None => {
420- let Some ( abs ) = root. path ( db) . as_file ( ) else {
421+ let Some ( path ) = root. path ( db) . as_path ( ) else {
421422 log:: warn!( "Skipping rescan: root path is not a filesystem path" ) ;
422423 return None ;
423424 } ;
424- let path = abs . as_path ( ) . to_path_buf ( ) ;
425+ let path = path . to_path_buf ( ) ;
425426 self . state . insert ( root, ScanState :: Scanning ) ;
426427 Some ( ScanRequest { root, path } )
427428 } ,
@@ -455,11 +456,11 @@ fn workspace_root_paths<DB: Db + DbInputs>(db: &DB) -> Vec<(Utf8PathBuf, Root)>
455456 . roots ( db)
456457 . iter ( )
457458 . filter_map ( |root| {
458- let Some ( abs ) = root. path ( db) . as_file ( ) else {
459+ let Some ( path ) = root. path ( db) . as_path ( ) else {
459460 log:: warn!( "Skipping workspace root: path is not a filesystem path" ) ;
460461 return None ;
461462 } ;
462- Some ( ( abs . as_path ( ) . to_path_buf ( ) , * root) )
463+ Some ( ( path . to_path_buf ( ) , * root) )
463464 } )
464465 . collect ( )
465466}
0 commit comments