Skip to content

Commit

Permalink
fix(data): Overwrite on 'is' error
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jun 7, 2024
1 parent 4075137 commit 2b22dd9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crates/snapbox/src/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,21 @@ impl Data {
///
/// This is generally used for `expected` data
pub fn is(self, format: DataFormat) -> Self {
let filters = self.filters.clone();

Check failure

Code scanning / clippy

using clone on type FilterSet which implements the Copy trait Error

using clone on type FilterSet which implements the Copy trait

Check failure

Code scanning / clippy

using clone on type FilterSet which implements the Copy trait Error

using clone on type FilterSet which implements the Copy trait
let source = self.source.clone();
match self.try_is(format) {
Ok(new) => new,
Err(err) => Self::error(err, format),
Err(err) => {
let inner = DataInner::Error(DataError {
error: err.into(),

Check failure

Code scanning / clippy

useless conversion to the same type: assert::error::Error Error

useless conversion to the same type: assert::error::Error

Check failure

Code scanning / clippy

useless conversion to the same type: assert::error::Error Error

useless conversion to the same type: assert::error::Error
intended: format,
});
Self {
inner,
source,
filters,
}
}
}
}

Expand Down

0 comments on commit 2b22dd9

Please sign in to comment.