Skip to content

Commit

Permalink
Merge pull request #42 from coreos/fileext-passthrough
Browse files Browse the repository at this point in the history
FileExt: Deprecate `copy_to`
  • Loading branch information
cgwalters authored Feb 15, 2022
2 parents b31da50 + 1cf50af commit dbc0bc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -689,6 +690,8 @@ pub(crate) fn fallback_file_copy(src: &File, dest: &File) -> io::Result<u64> {
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<u64>;

/// Update timestamps (both access and modification) to the current time.
Expand Down
1 change: 1 addition & 0 deletions tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fn exists() -> Result<()> {
}

#[test]
#[allow(deprecated)]
fn copy() -> Result<()> {
let td = tempfile::tempdir()?;
let src_p = td.path().join("testfile");
Expand Down

0 comments on commit dbc0bc6

Please sign in to comment.