Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cache_diff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
//!
//! - `#[cache_diff(rename = "<new name>")]` Specify custom name for the field
//! - `#[cache_diff(ignore)]` or `#[cache_diff(ignore = "<reason>")]` Ignores the given field with an optional comment string.
//! If the field is ignored because you're using a custom diff function (see container attributes) you can use
//! `cache_diff(ignore = "custom")` which will check that the container implements a custom function.
//! If the field is ignored because you're using a custom diff function (see container attributes) you can use
//! `cache_diff(ignore = "custom")` which will check that the container implements a custom function.
//!
//! ## Why
//!
Expand Down Expand Up @@ -249,7 +249,7 @@ pub trait CacheDiff {
/// Enable ANSI colors with `features = ["bullet_stream"]`
#[cfg(not(feature = "bullet_stream"))]
fn fmt_value<T: std::fmt::Display>(&self, value: &T) -> String {
format!("`{}`", value)
format!("`{value}`")
}
}
pub use cache_diff_derive::CacheDiff;
6 changes: 3 additions & 3 deletions cache_diff_derive/src/cache_diff_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ mod test {
};

let result = CacheDiffContainer::from_ast(&input);
assert!(result.is_err(), "Expected an error, got {:?}", result);
assert!(result.is_err(), "Expected an error, got {result:?}");
assert_eq!(
format!("{}", result.err().unwrap()),
r#"No fields to compare for CacheDiff, ensure struct has at least one named field that isn't `cache_diff(ignore)`-d"#
Expand All @@ -179,7 +179,7 @@ mod test {
};

let result = CacheDiffContainer::from_ast(&input);
assert!(result.is_err(), "Expected an error, got {:?}", result);
assert!(result.is_err(), "Expected an error, got {result:?}");
assert_eq!(
format!("{}", result.err().unwrap()),
r#"No fields to compare for CacheDiff, ensure struct has at least one named field that isn't `cache_diff(ignore)`-d"#
Expand All @@ -196,7 +196,7 @@ mod test {
};

let result = CacheDiffContainer::from_ast(&input);
assert!(result.is_err(), "Expected an error, got {:?}", result);
assert!(result.is_err(), "Expected an error, got {result:?}");
assert_eq!(
format!("{}", result.err().unwrap()),
r#"field `version` on Metadata marked ignored as custom, but no `#[cache_diff(custom = <function>)]` found on `Metadata`"#
Expand Down
8 changes: 4 additions & 4 deletions cache_diff_derive/src/cache_diff_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ mod test {
);

let result = ParsedField::from_field(&input);
assert!(result.is_err(), "Expected an error, got {:?}", result);
assert!(result.is_err(), "Expected an error, got {result:?}");
assert_eq!(
format!("{}", result.err().unwrap()).trim(),
formatdoc! {"
Expand All @@ -345,7 +345,7 @@ mod test {
},
);
let result = ParsedField::from_field(&input);
assert!(result.is_err(), "Expected an error, got {:?}", result);
assert!(result.is_err(), "Expected an error, got {result:?}");
assert_eq!(
format!("{}", result.err().unwrap()),
r#"Unknown cache_diff attribute: `unknown`. Must be one of `rename`, `display`, `ignore`"#
Expand All @@ -363,7 +363,7 @@ mod test {
},
);
let result = ParsedField::from_field(&input);
assert!(result.is_err(), "Expected an error, got {:?}", result);
assert!(result.is_err(), "Expected an error, got {result:?}");
assert_eq!(
format!("{}", result.err().unwrap()),
r#"The cache_diff attribute `ignore` renders other attributes useless, remove additional attributes"#
Expand All @@ -378,7 +378,7 @@ mod test {
},
);
let result = ParsedField::from_field(&input);
assert!(result.is_err(), "Expected an error, got {:?}", result);
assert!(result.is_err(), "Expected an error, got {result:?}");
assert_eq!(
format!("{}", result.err().unwrap()),
r#"The cache_diff attribute `ignore` renders other attributes useless, remove additional attributes"#
Expand Down
Loading