Skip to content

Commit dc39e12

Browse files
author
Paolo Tranquilli
committed
Shared: fix clippy
1 parent d9aaa25 commit dc39e12

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

shared/tree-sitter-extractor/src/trap.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ impl Compression {
306306

307307
#[test]
308308
fn limit_string_test() {
309-
assert_eq!("hello", limit_string(&"hello world".to_owned(), 5));
310-
assert_eq!("hi ☹", limit_string(&"hi ☹☹".to_owned(), 6));
311-
assert_eq!("hi ", limit_string(&"hi ☹☹".to_owned(), 5));
309+
assert_eq!("hello", limit_string("hello world", 5));
310+
assert_eq!("hi ☹", limit_string("hi ☹☹", 6));
311+
assert_eq!("hi ", limit_string("hi ☹☹", 5));
312312
}
313313

314314
#[test]

shared/tree-sitter-extractor/tests/common/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn create_source_dir(files: Vec<(&'static str, &'static str)>) -> SourceArch
2828
let path = source_archive_dir.join(filename);
2929
let mut file = File::create(&path).unwrap();
3030
file.write_all(contents.as_bytes()).unwrap();
31-
file_paths.push(PathBuf::from(path));
31+
file_paths.push(path);
3232
}
3333

3434
let file_list = {
@@ -53,7 +53,7 @@ pub fn create_source_dir(files: Vec<(&'static str, &'static str)>) -> SourceArch
5353
pub fn expect_trap_file(root_dir: &Path, filename: &str) {
5454
let root_dir_relative = {
5555
let r = root_dir.display().to_string();
56-
r.strip_prefix("/").unwrap().to_string()
56+
r.strip_prefix('/').unwrap().to_string()
5757
};
5858
let trap_gz = root_dir
5959
.join("trap")
@@ -69,5 +69,5 @@ pub fn expect_trap_file(root_dir: &Path, filename: &str) {
6969
fn create_dir(root: &Path, path: impl AsRef<Path>) -> PathBuf {
7070
let full_path = root.join(path);
7171
std::fs::create_dir_all(&full_path).expect("Failed to create directory");
72-
full_path.into()
72+
full_path
7373
}

shared/tree-sitter-extractor/tests/integration_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use codeql_extractor::extractor::simple;
22
use codeql_extractor::trap;
33

4-
use tree_sitter_ql;
4+
55

66
mod common;
77
use common::{create_source_dir, expect_trap_file, SourceArchive};

shared/tree-sitter-extractor/tests/multiple_languages.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use codeql_extractor::extractor::simple;
22
use codeql_extractor::trap;
3-
use tree_sitter_ql;
3+
44

55
mod common;
66
use common::{create_source_dir, expect_trap_file, SourceArchive};

0 commit comments

Comments
 (0)