File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -821,13 +821,14 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
821
821
let has_copy_file_range = HAS_COPY_FILE_RANGE . load ( Ordering :: Relaxed ) ;
822
822
let mut written = 0u64 ;
823
823
while written < len {
824
- // TODO should ideally use TryFrom
825
- let bytes_to_copy = if len - written > usize:: max_value ( ) as u64 {
826
- usize:: max_value ( )
827
- } else {
828
- ( len - written) as usize
829
- } ;
830
824
let copy_result = if has_copy_file_range {
825
+ // FIXME: should ideally use TryFrom
826
+ let bytes_to_copy = if len - written > usize:: max_value ( ) as u64 {
827
+ usize:: max_value ( )
828
+ } else {
829
+ ( len - written) as usize
830
+ } ;
831
+
831
832
let copy_result = unsafe {
832
833
// We actually don't have to adjust the offsets,
833
834
// because copy_file_range adjusts the file offset automatically
You can’t perform that action at this time.
0 commit comments