Skip to content

std::io::copy should take Read and Write traits by value #105643

Closed
@est31

Description

@est31

This was suggested by @alexcrichton way back in 2015:

mod std::io {
    fn copy<R: Read, W: Write>(r: R, w: W) -> io::Result<u64> { ... }
}

but it wasn't done as it regressed 3 (root) crates in a crater run. Still, ideally if the API breakage policy is ever revisited, it would be better to take Read and Write by-value, as a type impl'ing Read transmits this property to &mut references of it.

@rustbot label T-libs-api rust-2-breakage-wishlist

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions