Skip to content

Commit cbbfa37

Browse files
committed
Simplify test code
1 parent cc8dce5 commit cbbfa37

File tree

1 file changed

+2
-9
lines changed
  • crates/rust-analyzer/src/config

1 file changed

+2
-9
lines changed

crates/rust-analyzer/src/config/tree.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ fn parse_toml(
356356
mod tests {
357357
use std::path::{Path, PathBuf};
358358

359-
use itertools::Itertools;
360359
use vfs::{AbsPath, AbsPathBuf, VfsPath};
361360

362361
fn alloc_file_id(vfs: &mut Vfs, s: &str) -> FileId {
@@ -496,15 +495,9 @@ mod tests {
496495

497496
let source_roots =
498497
["/root/crate_a", "/root/crate_a/crate_b"].map(Path::new).map(AbsPath::assert);
499-
let source_root_tomls = source_roots
500-
.iter()
498+
let [crate_a, crate_b] = source_roots
501499
.map(|dir| dir.join("rust-analyzer.toml"))
502-
.map(|path| AbsPathBuf::try_from(path).unwrap())
503-
.map(|path| vfs.alloc_file_id(path.into()))
504-
.collect_vec();
505-
let &[crate_a, crate_b] = &source_root_tomls[..] else {
506-
panic!();
507-
};
500+
.map(|path| vfs.alloc_file_id(path.into()));
508501

509502
vfs.set_file_id_contents(
510503
xdg,

0 commit comments

Comments
 (0)