Skip to content

Commit 389a578

Browse files
chore: fix lint warnings from new clippy version (#975)
1 parent 88c48c3 commit 389a578

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

crates/apollo-compiler/tests/validation/variable.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ fn variables_in_const_contexts() {
257257

258258
assert!(
259259
!doc.to_string().contains("\"x\""),
260-
"Did not replace all string values with variables:\n{}",
261-
doc
260+
"Did not replace all string values with variables:\n{doc}",
262261
);
263262
let errors = doc.validate(&schema).unwrap_err().errors;
264263
let expected = expect_test::expect![[r#"
@@ -354,8 +353,7 @@ fn variables_in_const_contexts() {
354353

355354
assert!(
356355
!schema.to_string().contains("\"x\""),
357-
"Did not replace all string values with variables:\n{}",
358-
schema
356+
"Did not replace all string values with variables:\n{schema}",
359357
);
360358
let errors = schema.validate().unwrap_err().errors;
361359
let expected = expect_test::expect![[r#"

crates/apollo-parser/src/lexer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<'a> Cursor<'a> {
195195
}
196196
c => {
197197
return Err(Error::with_loc(
198-
format!("Unexpected character \"{}\"", c),
198+
format!(r#"Unexpected character "{c}""#),
199199
self.current_str().to_string(),
200200
token.index,
201201
));

fuzz/fuzz_targets/coordinate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ fuzz_target!(|data: &str| {
1414
);
1515
}
1616

17-
debug!("{:?}", coord);
17+
debug!("{coord:?}");
1818
});

fuzz/fuzz_targets/lexer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fuzz_target!(|data: &[u8]| {
2525
Ok(p) => p,
2626
};
2727
debug!("======= DOCUMENT =======");
28-
debug!("{}", doc_generated);
28+
debug!("{doc_generated}");
2929
debug!("========================");
3030

3131
// early return if the lexer detected an error
@@ -38,9 +38,9 @@ fuzz_target!(|data: &[u8]| {
3838
.collect::<Vec<&str>>()
3939
.join("\n");
4040
debug!("======= DOCUMENT =======");
41-
debug!("{}", doc_generated);
41+
debug!("{doc_generated}");
4242
debug!("========================");
43-
debug!("Lexer errors =========== \n{:?}", errors);
43+
debug!("Lexer errors =========== \n{errors:?}");
4444
debug!("========================");
4545
log_gql_doc(&doc_generated, &errors);
4646
}

fuzz/fuzz_targets/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fuzz_target!(|data: &[u8]| {
2525
Ok(p) => p,
2626
};
2727
debug!("======= DOCUMENT =======");
28-
debug!("{}", doc_generated);
28+
debug!("{doc_generated}");
2929
debug!("========================");
3030

3131
let tree = parser.parse();
@@ -38,7 +38,7 @@ fuzz_target!(|data: &[u8]| {
3838
.map(|err| err.message())
3939
.collect::<Vec<&str>>()
4040
.join("\n");
41-
debug!("Parser errors ========== \n{:?}", errors);
41+
debug!("Parser errors ========== \n{errors:?}");
4242
debug!("========================");
4343
log_gql_doc(&doc_generated, &errors);
4444
}

fuzz/fuzz_targets/reparse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ fn diff(left: impl Debug, left_label: &'static str, right: impl Debug, right_lab
8383
println!(
8484
"{}",
8585
similar_asserts::SimpleDiff::from_str(
86-
&format!("{:#?}", left),
87-
&format!("{:#?}", right),
86+
&format!("{left:#?}"),
87+
&format!("{right:#?}"),
8888
left_label,
8989
right_label
9090
)

0 commit comments

Comments
 (0)