From 1cf50af2987bc312ae84d3de1a987893862b6cd4 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 26 Jan 2022 10:16:27 -0500 Subject: [PATCH] FileExt: Deprecate `copy_to` It's no longer needed since https://github.com/rust-lang/rust/pull/75272 --- src/lib.rs | 3 +++ tests/basic.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 8c85b17..1b85449 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -433,6 +433,7 @@ fn map_nix_error(e: nix::Error) -> io::Error { io::Error::from_raw_os_error(e as i32) } +#[allow(deprecated)] fn copy_regfile_inner( src: &File, srcmeta: &std::fs::Metadata, @@ -689,6 +690,8 @@ pub(crate) fn fallback_file_copy(src: &File, dest: &File) -> io::Result { pub trait FileExt { /// Copy the entire contents of `self` to `to`. This uses operating system /// specific fast paths if available. + /// + #[deprecated = "Use std::io::copy instead"] fn copy_to(&self, to: &File) -> io::Result; /// Update timestamps (both access and modification) to the current time. diff --git a/tests/basic.rs b/tests/basic.rs index 7d54d84..2b77868 100644 --- a/tests/basic.rs +++ b/tests/basic.rs @@ -51,6 +51,7 @@ fn exists() -> Result<()> { } #[test] +#[allow(deprecated)] fn copy() -> Result<()> { let td = tempfile::tempdir()?; let src_p = td.path().join("testfile");