Skip to content

Implement Clone for File. #937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2021
Merged

Implement Clone for File. #937

merged 1 commit into from
Jan 15, 2021

Conversation

sunfishcode
Copy link
Contributor

Implement Clone for File so that Files can be passed into closures
for use in spawn_blocking. File's contents are already wrapped in
Arcs, so the implementation of clone is straightforward.

This also aligns with TcpStream which already implements Clone using
its internal Arc.

Implement `Clone` for `File` so that `File`s can be passed into closures
for use in `spawn_blocking`. `File`'s contents are already wrapped in
`Arc`s, so the implementation of `clone` is straightforward.

This also aligns with `TcpStream` which already implements `Clone` using
its internal `Arc`.
Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! -- We discussed this on Zulip, and happy to merge this once tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants