File tree 6 files changed +23
-15
lines changed
6 files changed +23
-15
lines changed Original file line number Diff line number Diff line change
1
+ msrv = " 1.85.0"
1
2
avoid-breaking-exported-api = false
2
3
check-private-items = true
3
4
cognitive-complexity-threshold = 24
Original file line number Diff line number Diff line change @@ -1259,13 +1259,17 @@ fn parse_path_args(
1259
1259
return Err ( "missing file operand" . into ( ) ) ;
1260
1260
} else if paths. len ( ) == 1 && options. target_dir . is_none ( ) {
1261
1261
// Only one file specified
1262
- return Err ( format ! ( "missing destination file operand after {:?}" , paths[ 0 ] ) . into ( ) ) ;
1262
+ return Err ( format ! (
1263
+ "missing destination file operand after {}" ,
1264
+ paths[ 0 ] . display( ) . to_string( ) . quote( )
1265
+ )
1266
+ . into ( ) ) ;
1263
1267
}
1264
1268
1265
1269
// Return an error if the user requested to copy more than one
1266
1270
// file source to a file target
1267
1271
if options. no_target_dir && options. target_dir . is_none ( ) && paths. len ( ) > 2 {
1268
- return Err ( format ! ( "extra operand {:? }" , paths[ 2 ] ) . into ( ) ) ;
1272
+ return Err ( format ! ( "extra operand {:}" , paths[ 2 ] . display ( ) . to_string ( ) . quote ( ) ) . into ( ) ) ;
1269
1273
}
1270
1274
1271
1275
let target = match options. target_dir {
Original file line number Diff line number Diff line change @@ -84,7 +84,12 @@ pub(crate) fn copy_on_write(
84
84
// support COW).
85
85
match reflink_mode {
86
86
ReflinkMode :: Always => {
87
- return Err ( format ! ( "failed to clone {source:?} from {dest:?}: {error}" ) . into ( ) ) ;
87
+ return Err ( format ! (
88
+ "failed to clone {} from {}: {error}" ,
89
+ source. display( ) ,
90
+ dest. display( )
91
+ )
92
+ . into ( ) ) ;
88
93
}
89
94
_ => {
90
95
copy_debug. reflink = OffloadReflinkDebug :: Yes ;
Original file line number Diff line number Diff line change @@ -900,16 +900,15 @@ mod tests {
900
900
if let Some ( rows) = self . options . lines {
901
901
self . rows = rows;
902
902
}
903
- let pager = Pager :: new (
903
+ Pager :: new (
904
904
InputType :: File ( BufReader :: new ( tmpfile) ) ,
905
905
self . rows ,
906
906
None ,
907
907
self . next_file ,
908
908
& self . options ,
909
909
out,
910
910
)
911
- . unwrap ( ) ;
912
- pager
911
+ . unwrap ( )
913
912
}
914
913
915
914
fn silent ( mut self ) -> Self {
Original file line number Diff line number Diff line change @@ -826,7 +826,7 @@ fn rename_dir_fallback(
826
826
io:: ErrorKind :: PermissionDenied ,
827
827
"Permission denied" ,
828
828
) ) ,
829
- _ => Err ( io:: Error :: new ( io :: ErrorKind :: Other , format ! ( "{err:?}" ) ) ) ,
829
+ _ => Err ( io:: Error :: other ( format ! ( "{err:?}" ) ) ) ,
830
830
} ,
831
831
_ => Ok ( ( ) ) ,
832
832
}
Original file line number Diff line number Diff line change 2
2
//
3
3
// For the full copyright and license information, please view the LICENSE
4
4
// file that was distributed with this source code.
5
+
5
6
// spell-checker:ignore (flags) reflink (fs) tmpfs (linux) rlimit Rlim NOFILE clob btrfs neve ROOTDIR USERDIR procfs outfile uufs xattrs
6
7
// spell-checker:ignore bdfl hlsl IRWXO IRWXG nconfined matchpathcon libselinux-devel
7
- use uutests:: at_and_ucmd;
8
- use uutests:: new_ucmd;
9
- use uutests:: path_concat;
8
+ use uucore:: display:: Quotable ;
10
9
use uutests:: util:: TestScenario ;
11
- use uutests:: util_name;
10
+ use uutests:: { at_and_ucmd , new_ucmd , path_concat , util_name} ;
12
11
13
12
#[ cfg( not( windows) ) ]
14
13
use std:: fs:: set_permissions;
@@ -3946,10 +3945,10 @@ fn test_cp_only_source_no_target() {
3946
3945
let ts = TestScenario :: new ( util_name ! ( ) ) ;
3947
3946
let at = & ts. fixtures ;
3948
3947
at. touch ( "a" ) ;
3949
- ts. ucmd ( )
3950
- . arg ( "a" )
3951
- . fails ( )
3952
- . stderr_contains ( "missing destination file operand after \" a \" " ) ;
3948
+ ts. ucmd ( ) . arg ( "a" ) . fails ( ) . stderr_contains ( format ! (
3949
+ "missing destination file operand after {}" ,
3950
+ "a" . quote ( )
3951
+ ) ) ;
3953
3952
}
3954
3953
3955
3954
#[ test]
You can’t perform that action at this time.
0 commit comments