Skip to content

Commit 1308665

Browse files
authored
Fix failing Clippy lints (#15)
These were failing on `main`. Mostly fixed via `cargo clippy --fix`.
1 parent 5d0a172 commit 1308665

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

cache_diff/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Attributes for fields are:
3434

3535
- `#[cache_diff(rename = "<new name>")]` Specify custom name for the field
3636
- `#[cache_diff(ignore)]` or `#[cache_diff(ignore = "<reason>")]` Ignores the given field with an optional comment string.
37-
If the field is ignored because you're using a custom diff function (see container attributes) you can use
38-
`cache_diff(ignore = "custom")` which will check that the container implements a custom function.
37+
If the field is ignored because you're using a custom diff function (see container attributes) you can use
38+
`cache_diff(ignore = "custom")` which will check that the container implements a custom function.
3939

4040
### Why
4141

cache_diff/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
//!
1616
//! - `#[cache_diff(rename = "<new name>")]` Specify custom name for the field
1717
//! - `#[cache_diff(ignore)]` or `#[cache_diff(ignore = "<reason>")]` Ignores the given field with an optional comment string.
18-
//! If the field is ignored because you're using a custom diff function (see container attributes) you can use
19-
//! `cache_diff(ignore = "custom")` which will check that the container implements a custom function.
18+
//! If the field is ignored because you're using a custom diff function (see container attributes) you can use
19+
//! `cache_diff(ignore = "custom")` which will check that the container implements a custom function.
2020
//!
2121
//! ## Why
2222
//!
@@ -249,7 +249,7 @@ pub trait CacheDiff {
249249
/// Enable ANSI colors with `features = ["bullet_stream"]`
250250
#[cfg(not(feature = "bullet_stream"))]
251251
fn fmt_value<T: std::fmt::Display>(&self, value: &T) -> String {
252-
format!("`{}`", value)
252+
format!("`{value}`")
253253
}
254254
}
255255
pub use cache_diff_derive::CacheDiff;

cache_diff_derive/src/cache_diff_container.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ mod test {
165165
};
166166

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

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

198198
let result = CacheDiffContainer::from_ast(&input);
199-
assert!(result.is_err(), "Expected an error, got {:?}", result);
199+
assert!(result.is_err(), "Expected an error, got {result:?}");
200200
assert_eq!(
201201
format!("{}", result.err().unwrap()),
202202
r#"field `version` on Metadata marked ignored as custom, but no `#[cache_diff(custom = <function>)]` found on `Metadata`"#

cache_diff_derive/src/cache_diff_field.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ mod test {
323323
);
324324

325325
let result = ParsedField::from_field(&input);
326-
assert!(result.is_err(), "Expected an error, got {:?}", result);
326+
assert!(result.is_err(), "Expected an error, got {result:?}");
327327
assert_eq!(
328328
format!("{}", result.err().unwrap()).trim(),
329329
formatdoc! {"
@@ -345,7 +345,7 @@ mod test {
345345
},
346346
);
347347
let result = ParsedField::from_field(&input);
348-
assert!(result.is_err(), "Expected an error, got {:?}", result);
348+
assert!(result.is_err(), "Expected an error, got {result:?}");
349349
assert_eq!(
350350
format!("{}", result.err().unwrap()),
351351
r#"Unknown cache_diff attribute: `unknown`. Must be one of `rename`, `display`, `ignore`"#
@@ -363,7 +363,7 @@ mod test {
363363
},
364364
);
365365
let result = ParsedField::from_field(&input);
366-
assert!(result.is_err(), "Expected an error, got {:?}", result);
366+
assert!(result.is_err(), "Expected an error, got {result:?}");
367367
assert_eq!(
368368
format!("{}", result.err().unwrap()),
369369
r#"The cache_diff attribute `ignore` renders other attributes useless, remove additional attributes"#
@@ -378,7 +378,7 @@ mod test {
378378
},
379379
);
380380
let result = ParsedField::from_field(&input);
381-
assert!(result.is_err(), "Expected an error, got {:?}", result);
381+
assert!(result.is_err(), "Expected an error, got {result:?}");
382382
assert_eq!(
383383
format!("{}", result.err().unwrap()),
384384
r#"The cache_diff attribute `ignore` renders other attributes useless, remove additional attributes"#

0 commit comments

Comments
 (0)