From 3950dddfdef616992ceddcda8a00fff1559e3631 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sun, 28 Jul 2024 09:34:26 +0300 Subject: [PATCH] fix(rust): fix new clippy warnings --- cli/build.rs | 3 +++ cli/src/tests/parser_test.rs | 5 +---- cli/src/tests/tree_test.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/build.rs b/cli/build.rs index a29a940b..375d87d6 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -11,6 +11,9 @@ fn main() { println!("cargo:rustc-env=BUILD_SHA={git_sha}"); } + println!("cargo:rustc-check-cfg=cfg(sanitizing)"); + println!("cargo:rustc-check-cfg=cfg(TREE_SITTER_EMBED_WASM_BINDING)"); + if web_playground_files_present() { println!("cargo:rustc-cfg=TREE_SITTER_EMBED_WASM_BINDING"); } diff --git a/cli/src/tests/parser_test.rs b/cli/src/tests/parser_test.rs index 3374279c..f4beefea 100644 --- a/cli/src/tests/parser_test.rs +++ b/cli/src/tests/parser_test.rs @@ -221,10 +221,7 @@ fn test_parsing_text_with_byte_order_mark() { // Parse UTF16 text with a BOM let tree = parser - .parse_utf16( - &"\u{FEFF}fn a() {}".encode_utf16().collect::>(), - None, - ) + .parse_utf16("\u{FEFF}fn a() {}".encode_utf16().collect::>(), None) .unwrap(); assert_eq!( tree.root_node().to_sexp(), diff --git a/cli/src/tests/tree_test.rs b/cli/src/tests/tree_test.rs index be3f7794..3e4b2775 100644 --- a/cli/src/tests/tree_test.rs +++ b/cli/src/tests/tree_test.rs @@ -724,7 +724,7 @@ fn get_changed_ranges( edit: &Edit, ) -> Vec { perform_edit(tree, source_code, edit).unwrap(); - let new_tree = parser.parse(&source_code, Some(tree)).unwrap(); + let new_tree = parser.parse(source_code, Some(tree)).unwrap(); let result = tree.changed_ranges(&new_tree).collect(); *tree = new_tree; result