File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -587,13 +587,15 @@ mod tests {
587587 use super :: * ;
588588 use crate :: test_utils:: create_populate_tmp_dir;
589589 use all_asserts:: assert_true;
590+ use std:: slice;
590591
591592 #[ test]
592593 fn test_indexing_compiler_default_folders ( ) {
593594 let tmp_dir = create_populate_tmp_dir ( ) ;
594595 let dirname = tmp_dir. path ( ) . to_path_buf ( ) ;
595596
596- let include_finder = CompilerDefaultIncludes :: new ( & [ dirname. clone ( ) ] , & [ dirname] ) ;
597+ let include_finder =
598+ CompilerDefaultIncludes :: new ( slice:: from_ref ( & dirname) , slice:: from_ref ( & dirname) ) ;
597599 let default_c_include_dir_content = & include_finder. default_c_include_dir_content ;
598600 let default_cpp_include_dir_content = & include_finder. default_cpp_include_dir_content ;
599601
Original file line number Diff line number Diff line change @@ -638,6 +638,7 @@ mod tests {
638638
639639 mod find_includes {
640640 use crate :: project_definitions:: IncludeKind ;
641+ use std:: slice;
641642
642643 use super :: * ;
643644
@@ -836,7 +837,7 @@ mod tests {
836837 & project_files,
837838 & system_files,
838839 & compiler_defaults,
839- & [ include_directive. clone ( ) ] ,
840+ slice :: from_ref ( & include_directive) ,
840841 ) ;
841842
842843 let empty: Vec < PathBuf > = vec ! [ ] ;
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ impl Hash for SourceFile {
116116
117117impl PartialOrd < Self > for SourceFile {
118118 fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
119- Some ( self . path . cmp ( & other. path ) )
119+ Some ( self . cmp ( other) )
120120 }
121121}
122122
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use all_asserts::assert_true;
22use std:: fs:: File ;
33use std:: path:: PathBuf ;
44use std:: { env, fs} ;
5- use tempfile:: { tempdir , TempDir } ;
5+ use tempfile:: { TempDir , tempdir } ;
66
77/// This function tries to get the root test resource path.
88/// If `allow_symlinks` is `false` will avoid the bazel off-tree test directory as this contains
@@ -124,9 +124,7 @@ mod tests {
124124 assert_true ! ( file_maybe_symlinked. exists( ) ) ;
125125 assert_true ! ( file_maybe_symlinked. ends_with( "tests/resources/dir1/file1.c" ) ) ;
126126
127- let is_bazel = env:: var ( "BAZEL_TEST" )
128- . map ( |bazel| bazel == "1" )
129- . unwrap_or ( false ) ;
127+ let is_bazel = env:: var ( "BAZEL_TEST" ) . is_ok_and ( |bazel| bazel == "1" ) ;
130128 if is_bazel {
131129 assert_true ! ( file_maybe_symlinked. is_symlink( ) ) ;
132130 } else {
You can’t perform that action at this time.
0 commit comments