Skip to content

Commit 66e3e8b

Browse files
committed
Fix clippy suggestions
1 parent a577c19 commit 66e3e8b

File tree

1 file changed

+7
-7
lines changed
  • crates/red_knot_test/src

1 file changed

+7
-7
lines changed

crates/red_knot_test/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use ruff_db::system::{DbWithTestSystem, SystemPathBuf};
1212
use ruff_db::testing::{setup_logging, setup_logging_with_filter};
1313
use ruff_source_file::{LineIndex, OneIndexed};
1414
use ruff_text_size::TextSize;
15-
use salsa::Setter;
15+
use std::fmt::Write;
1616

1717
mod assertion;
1818
mod config;
@@ -108,7 +108,7 @@ fn run_test(db: &mut db::Db, test: &parser::MarkdownTest) -> Result<(), Failures
108108
"Supported file types are: py, pyi, text"
109109
);
110110

111-
let full_path = if embedded.path.starts_with("/") {
111+
let full_path = if embedded.path.starts_with('/') {
112112
SystemPathBuf::from(embedded.path)
113113
} else {
114114
project_root.join(embedded.path)
@@ -146,16 +146,16 @@ fn run_test(db: &mut db::Db, test: &parser::MarkdownTest) -> Result<(), Failures
146146
let versions_file = typeshed_path.join("stdlib/VERSIONS");
147147
let contents = typeshed_files
148148
.iter()
149-
.map(|path| {
149+
.fold(String::new(), |mut content, path| {
150150
// This is intentionally kept simple:
151151
let module_path = path
152152
.as_str()
153153
.trim_end_matches(".pyi")
154154
.trim_end_matches("/__init__")
155-
.replace("/", ".");
156-
format!("{module_path}: 3.8-\n")
157-
})
158-
.collect::<String>();
155+
.replace('/', ".");
156+
let _ = writeln!(content, "{module_path}: 3.8-");
157+
content
158+
});
159159
db.write_file(&versions_file, contents).unwrap();
160160
}
161161
}

0 commit comments

Comments
 (0)