Skip to content

Commit 6a4e81f

Browse files
committed
fix: resolve clippy warnings for CI (Rust 1.94)
1 parent 7aa6767 commit 6a4e81f

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

crates/codelens-core/benches/counting.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::collections::HashMap;
2-
31
use criterion::{black_box, criterion_group, criterion_main, Criterion};
42

53
use codelens_core::analyzer::counter::count_stats;
@@ -15,7 +13,8 @@ fn make_rust_lang() -> Language {
1513
block_comments = [["/*", "*/"]]
1614
nested_comments = true
1715
"#;
18-
let langs: std::collections::HashMap<String, Language> = toml::from_str(toml).unwrap();
16+
let langs: std::collections::HashMap<String, Language> =
17+
toml::from_str(toml).unwrap();
1918
langs.into_values().next().unwrap()
2019
}
2120

@@ -27,12 +26,12 @@ fn generate_rust_code(lines: usize) -> String {
2726
1 => code.push_str("fn some_function() {\n"),
2827
2 => code.push_str(" let x = \"hello world\";\n"),
2928
3 => code.push_str(" /* inline block comment */\n"),
30-
4 => code.push_str("\n"),
29+
4 => code.push('\n'),
3130
5 => code.push_str(" if x > 0 {\n"),
3231
6 => code.push_str(" println!(\"value: {}\", x);\n"),
3332
7 => code.push_str(" }\n"),
3433
8 => code.push_str("}\n"),
35-
_ => code.push_str("\n"),
34+
_ => code.push('\n'),
3635
}
3736
}
3837
code

crates/codelens-core/src/analyzer/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ mod tests {
261261
let analyzer = FileAnalyzer::new(registry, &Config::default());
262262

263263
let mut tmp = NamedTempFile::with_suffix(".rs").unwrap();
264-
write!(tmp, "fn main() {{}}\n").unwrap();
264+
writeln!(tmp, "fn main() {{}}").unwrap();
265265

266266
let result = analyzer.analyze(tmp.path()).unwrap().unwrap();
267267
assert_eq!(result.lines.total, 1);

0 commit comments

Comments
 (0)