@@ -12,7 +12,7 @@ use ruff_db::system::{DbWithTestSystem, SystemPathBuf};
12
12
use ruff_db:: testing:: { setup_logging, setup_logging_with_filter} ;
13
13
use ruff_source_file:: { LineIndex , OneIndexed } ;
14
14
use ruff_text_size:: TextSize ;
15
- use salsa :: Setter ;
15
+ use std :: fmt :: Write ;
16
16
17
17
mod assertion;
18
18
mod config;
@@ -108,7 +108,7 @@ fn run_test(db: &mut db::Db, test: &parser::MarkdownTest) -> Result<(), Failures
108
108
"Supported file types are: py, pyi, text"
109
109
) ;
110
110
111
- let full_path = if embedded. path . starts_with ( "/" ) {
111
+ let full_path = if embedded. path . starts_with ( '/' ) {
112
112
SystemPathBuf :: from ( embedded. path )
113
113
} else {
114
114
project_root. join ( embedded. path )
@@ -146,16 +146,16 @@ fn run_test(db: &mut db::Db, test: &parser::MarkdownTest) -> Result<(), Failures
146
146
let versions_file = typeshed_path. join ( "stdlib/VERSIONS" ) ;
147
147
let contents = typeshed_files
148
148
. iter ( )
149
- . map ( | path| {
149
+ . fold ( String :: new ( ) , | mut content , path| {
150
150
// This is intentionally kept simple:
151
151
let module_path = path
152
152
. as_str ( )
153
153
. trim_end_matches ( ".pyi" )
154
154
. 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
+ } ) ;
159
159
db. write_file ( & versions_file, contents) . unwrap ( ) ;
160
160
}
161
161
}
0 commit comments