chore(cli): apply clippy fixes

This commit is contained in:
Amaan Qureshi 2024-02-04 01:30:33 -05:00
parent 1fb16a72ac
commit 04ff704bca
No known key found for this signature in database
GPG key ID: E67890ADC4227273
49 changed files with 1094 additions and 1277 deletions

View file

@ -78,14 +78,14 @@ fn test_node_and_cursor_ref_in_fut() {
let fut_val = async {
yield_now().await;
root.to_sexp();
let _ = root.to_sexp();
};
yield_now().await;
let fut_ref = async {
yield_now().await;
root_ref.to_sexp();
let _ = root_ref.to_sexp();
cursor_ref.goto_first_child();
};
@ -117,14 +117,14 @@ fn test_node_and_cursor_ref_in_fut_with_fut_fabrics() {
let fut_val = || async {
yield_now().await;
root.to_sexp();
let _ = root.to_sexp();
};
yield_now().await;
let fut_ref = || async move {
yield_now().await;
root_ref.to_sexp();
let _ = root_ref.to_sexp();
cursor_ref.goto_first_child();
};
@ -157,7 +157,7 @@ fn test_node_and_cursor_ref_in_fut_with_inner_spawns() {
let mut cursor = tree.walk();
let cursor_ref = &mut cursor;
yield_now().await;
root.to_sexp();
let _ = root.to_sexp();
cursor_ref.goto_first_child();
}
};
@ -172,7 +172,7 @@ fn test_node_and_cursor_ref_in_fut_with_inner_spawns() {
let mut cursor = tree.walk();
let cursor_ref = &mut cursor;
yield_now().await;
root_ref.to_sexp();
let _ = root_ref.to_sexp();
cursor_ref.goto_first_child();
}
};
@ -228,7 +228,7 @@ async fn yield_now() {
type Output = ();
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
cx.waker().clone().wake();
cx.waker().wake_by_ref();
if self.yielded {
return Poll::Ready(());
}

View file

@ -166,7 +166,7 @@ fn test_language_corpus(
let tree = parser.parse(&test.input, None).unwrap();
let mut actual_output = tree.root_node().to_sexp();
if !test.has_fields {
actual_output = strip_sexp_fields(actual_output);
actual_output = strip_sexp_fields(&actual_output);
}
if actual_output != test.output {
@ -253,7 +253,7 @@ fn test_language_corpus(
// Verify that the final tree matches the expectation from the corpus.
let mut actual_output = tree3.root_node().to_sexp();
if !test.has_fields {
actual_output = strip_sexp_fields(actual_output);
actual_output = strip_sexp_fields(&actual_output);
}
if actual_output != test.output {
@ -382,7 +382,7 @@ fn test_feature_corpus_files() {
let tree = parser.parse(&test.input, None).unwrap();
let mut actual_output = tree.root_node().to_sexp();
if !test.has_fields {
actual_output = strip_sexp_fields(actual_output);
actual_output = strip_sexp_fields(&actual_output);
}
if actual_output == test.output {
true

View file

@ -34,7 +34,7 @@ fn test_lookahead_iterator() {
lookahead.reset_state(next_state);
assert!(lookahead.iter_names().eq(expected_symbols));
lookahead.reset(language.clone(), next_state);
lookahead.reset(&language, next_state);
assert!(lookahead
.map(|s| language.node_kind_for_id(s).unwrap())
.eq(expected_symbols));

View file

@ -4188,7 +4188,7 @@ fn test_query_is_pattern_guaranteed_at_step() {
];
allocations::record(|| {
eprintln!("");
eprintln!();
for row in rows.iter() {
if let Some(filter) = EXAMPLE_FILTER.as_ref() {
@ -4283,7 +4283,7 @@ fn test_query_is_pattern_rooted() {
];
allocations::record(|| {
eprintln!("");
eprintln!();
let language = get_language("python");
for row in &rows {
@ -4381,7 +4381,7 @@ fn test_query_is_pattern_non_local() {
];
allocations::record(|| {
eprintln!("");
eprintln!();
for row in &rows {
if let Some(filter) = EXAMPLE_FILTER.as_ref() {
@ -4611,7 +4611,7 @@ fn test_capture_quantifiers() {
];
allocations::record(|| {
eprintln!("");
eprintln!();
for row in rows.iter() {
if let Some(filter) = EXAMPLE_FILTER.as_ref() {

View file

@ -29,7 +29,7 @@ fn test_highlight_test_with_basic_test() {
.join("\n");
let assertions =
parse_position_comments(&mut Parser::new(), language, source.as_bytes()).unwrap();
parse_position_comments(&mut Parser::new(), &language, source.as_bytes()).unwrap();
assert_eq!(
assertions,
&[

View file

@ -22,7 +22,7 @@ fn test_tags_test_with_basic_test() {
.join("\n");
let assertions =
parse_position_comments(&mut Parser::new(), language, source.as_bytes()).unwrap();
parse_position_comments(&mut Parser::new(), &language, source.as_bytes()).unwrap();
assert_eq!(
assertions,

View file

@ -363,7 +363,7 @@ fn test_tree_cursor() {
assert_eq!(cursor.node().start_position(), Point { row: 1, column: 29 });
let mut copy = tree.walk();
copy.reset_to(cursor);
copy.reset_to(&cursor);
assert_eq!(copy.node().kind(), "{");
assert_eq!(copy.node().is_named(), false);