@@ -561,8 +561,8 @@ impl Loader {
561561 // If multiple language configurations match, then determine which
562562 // one to use by applying the configurations' content regexes.
563563 else {
564- let file_contents =
565- fs :: read ( path ) . with_context ( || format ! ( "Failed to read path {path:?}" ) ) ?;
564+ let file_contents = fs :: read ( path )
565+ . with_context ( || format ! ( "Failed to read path {}" , path . display ( ) ) ) ?;
566566 let file_contents = String :: from_utf8_lossy ( & file_contents) ;
567567 let mut best_score = -2isize ;
568568 let mut best_configuration_id = None ;
@@ -780,8 +780,8 @@ impl Loader {
780780 if recompile {
781781 fs:: create_dir_all ( lock_path. parent ( ) . unwrap ( ) ) . with_context ( || {
782782 format ! (
783- "Failed to create directory {:? }" ,
784- lock_path. parent( ) . unwrap( )
783+ "Failed to create directory {}" ,
784+ lock_path. parent( ) . unwrap( ) . display ( )
785785 )
786786 } ) ?;
787787 let lock_file = fs:: OpenOptions :: new ( )
@@ -799,7 +799,7 @@ impl Loader {
799799 }
800800
801801 let library = unsafe { Library :: new ( & output_path) }
802- . with_context ( || format ! ( "Error opening dynamic library {output_path:?}" ) ) ?;
802+ . with_context ( || format ! ( "Error opening dynamic library {}" , output_path . display ( ) ) ) ?;
803803 let language = unsafe {
804804 let language_fn = library
805805 . get :: < Symbol < unsafe extern "C" fn ( ) -> Language > > ( language_fn_name. as_bytes ( ) )
@@ -1564,7 +1564,7 @@ impl LanguageConfiguration<'_> {
15641564 error. row = source[ range. start ..offset_within_section]
15651565 . matches ( '\n' )
15661566 . count ( ) ;
1567- Error :: from ( error) . context ( format ! ( "Error in query file {path:?}" ) )
1567+ Error :: from ( error) . context ( format ! ( "Error in query file {}" , path . display ( ) ) )
15681568 }
15691569
15701570 #[ allow( clippy:: type_complexity) ]
@@ -1581,7 +1581,7 @@ impl LanguageConfiguration<'_> {
15811581 let abs_path = self . root_path . join ( path) ;
15821582 let prev_query_len = query. len ( ) ;
15831583 query += & fs:: read_to_string ( & abs_path)
1584- . with_context ( || format ! ( "Failed to read query file {path:?}" ) ) ?;
1584+ . with_context ( || format ! ( "Failed to read query file {}" , path . display ( ) ) ) ?;
15851585 path_ranges. push ( ( path. clone ( ) , prev_query_len..query. len ( ) ) ) ;
15861586 }
15871587 } else {
@@ -1599,7 +1599,7 @@ impl LanguageConfiguration<'_> {
15991599 let path = queries_path. join ( default_path) ;
16001600 if path. exists ( ) {
16011601 query = fs:: read_to_string ( & path)
1602- . with_context ( || format ! ( "Failed to read query file {path:?}" ) ) ?;
1602+ . with_context ( || format ! ( "Failed to read query file {}" , path . display ( ) ) ) ?;
16031603 path_ranges. push ( ( PathBuf :: from ( default_path) , 0 ..query. len ( ) ) ) ;
16041604 }
16051605 }
@@ -1612,8 +1612,8 @@ fn needs_recompile(lib_path: &Path, paths_to_check: &[PathBuf]) -> Result<bool>
16121612 if !lib_path. exists ( ) {
16131613 return Ok ( true ) ;
16141614 }
1615- let lib_mtime =
1616- mtime ( lib_path ) . with_context ( || format ! ( "Failed to read mtime of {lib_path:?}" ) ) ?;
1615+ let lib_mtime = mtime ( lib_path )
1616+ . with_context ( || format ! ( "Failed to read mtime of {}" , lib_path . display ( ) ) ) ?;
16171617 for path in paths_to_check {
16181618 if mtime ( path) ? > lib_mtime {
16191619 return Ok ( true ) ;
0 commit comments