mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-17 07:45:08 +00:00
format_collect
This commit is contained in:
parent
d37f4e0d21
commit
771c6c9271
8 changed files with 54 additions and 39 deletions
|
@ -11,6 +11,7 @@ use std::{
|
|||
use ast::HasName;
|
||||
use expect_test::expect_file;
|
||||
use rayon::prelude::*;
|
||||
use stdx::format_to_acc;
|
||||
use test_utils::{bench, bench_fixture, project_root};
|
||||
|
||||
use crate::{ast, fuzz, AstNode, SourceFile, SyntaxError};
|
||||
|
@ -104,10 +105,9 @@ fn self_hosting_parsing() {
|
|||
.collect::<Vec<_>>();
|
||||
|
||||
if !errors.is_empty() {
|
||||
let errors = errors
|
||||
.into_iter()
|
||||
.map(|(path, err)| format!("{}: {:?}\n", path.display(), err[0]))
|
||||
.collect::<String>();
|
||||
let errors = errors.into_iter().fold(String::new(), |mut acc, (path, err)| {
|
||||
format_to_acc!(acc, "{}: {:?}\n", path.display(), err[0])
|
||||
});
|
||||
panic!("Parsing errors:\n{errors}\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue