Skip to content

Commit

Permalink
Merge pull request #333 from epage/fixes
Browse files Browse the repository at this point in the history
fix(assert): Rename Assert::subsitutions to Assert::redact_with
  • Loading branch information
epage authored May 24, 2024
2 parents d56700c + c528818 commit 413b3b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/snapbox/src/assert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,17 @@ impl Assert {
}

/// Override the default [`Redactions`][crate::Redactions]
pub fn substitutions(mut self, substitutions: crate::Redactions) -> Self {
pub fn redact_with(mut self, substitutions: crate::Redactions) -> Self {
self.substitutions = substitutions;
self
}

/// Override the default [`Redactions`][crate::Redactions]
#[deprecated(since = "0.6.2", note = "Replaced with `Assert::redact_with`")]
pub fn substitutions(self, substitutions: crate::Redactions) -> Self {
self.redact_with(substitutions)
}

/// Specify whether text should have path separators normalized
///
/// The default is normalized
Expand All @@ -428,6 +434,6 @@ impl Default for Assert {
substitutions: Default::default(),
palette: crate::report::Palette::color(),
}
.substitutions(crate::Redactions::with_exe())
.redact_with(crate::Redactions::with_exe())
}
}

0 comments on commit 413b3b8

Please sign in to comment.