Skip to content

Commit

Permalink
backhand: Fix clippy::incorrect_clone_impl_on_copy_type
Browse files Browse the repository at this point in the history
* Remove manual Clone impl for FilesystemReaderFile.
* See: https://rust-lang.github.io/rust-clippy/master/index.html#/incorrect_clone_impl_on_copy_type
  >  If both Clone and Copy are implemented, they must agree.
  > This is done by dereferencing self in Clone’s implementation.
  > Anything else is incorrect.
  • Loading branch information
wcampbell0x2a committed Jul 18, 2023
1 parent fcca5f5 commit ffa76cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## backhand
### Bug Fix
- When creating an empty image using `FilesystemWriter::default()`, correctly create the ID table for UID and GID entries. Reported: ([@hwittenborn](https://github.com/hwittenborn)) ([!250](https://github.com/wcampbell0x2a/backhand/issues/275)), Fixed: ([#275](https://github.com/wcampbell0x2a/backhand/pull/275))
- Remove manual `Clone` impl for `FilesystemReaderFile` ([#277](https://github.com/wcampbell0x2a/backhand/pull/277))

## All binaries
### Changes
Expand Down
11 changes: 1 addition & 10 deletions src/filesystem/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,12 @@ impl FilesystemReader {
}

/// Filesystem handle for file
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct FilesystemReaderFile<'a> {
pub(crate) system: &'a FilesystemReader,
pub(crate) basic: &'a BasicFile,
}

impl<'a> Clone for FilesystemReaderFile<'a> {
fn clone(&self) -> Self {
Self {
system: self.system,
basic: self.basic,
}
}
}

impl<'a> FilesystemReaderFile<'a> {
pub fn new(system: &'a FilesystemReader, basic: &'a BasicFile) -> Self {
Self { system, basic }
Expand Down

0 comments on commit ffa76cb

Please sign in to comment.