Skip to content

Commit 1cf50af

Browse files
committed
FileExt: Deprecate copy_to
It's no longer needed since rust-lang/rust#75272
1 parent b31da50 commit 1cf50af

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ fn map_nix_error(e: nix::Error) -> io::Error {
433433
io::Error::from_raw_os_error(e as i32)
434434
}
435435

436+
#[allow(deprecated)]
436437
fn copy_regfile_inner(
437438
src: &File,
438439
srcmeta: &std::fs::Metadata,
@@ -689,6 +690,8 @@ pub(crate) fn fallback_file_copy(src: &File, dest: &File) -> io::Result<u64> {
689690
pub trait FileExt {
690691
/// Copy the entire contents of `self` to `to`. This uses operating system
691692
/// specific fast paths if available.
693+
///
694+
#[deprecated = "Use std::io::copy instead"]
692695
fn copy_to(&self, to: &File) -> io::Result<u64>;
693696

694697
/// Update timestamps (both access and modification) to the current time.

tests/basic.rs

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ fn exists() -> Result<()> {
5151
}
5252

5353
#[test]
54+
#[allow(deprecated)]
5455
fn copy() -> Result<()> {
5556
let td = tempfile::tempdir()?;
5657
let src_p = td.path().join("testfile");

0 commit comments

Comments
 (0)