mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-27 13:54:20 +00:00
Replace if let
with match
where appropriate
This commit is contained in:
parent
f29796da61
commit
9583dd5725
44 changed files with 201 additions and 269 deletions
|
@ -227,12 +227,9 @@ where
|
|||
T: crate::AstNode,
|
||||
F: Fn(&str) -> Result<T, ()>,
|
||||
{
|
||||
dir_tests(&test_data_dir(), ok_paths, "rast", |text, path| {
|
||||
if let Ok(node) = f(text) {
|
||||
format!("{:#?}", crate::ast::AstNode::syntax(&node))
|
||||
} else {
|
||||
panic!("Failed to parse '{:?}'", path);
|
||||
}
|
||||
dir_tests(&test_data_dir(), ok_paths, "rast", |text, path| match f(text) {
|
||||
Ok(node) => format!("{:#?}", crate::ast::AstNode::syntax(&node)),
|
||||
Err(_) => panic!("Failed to parse '{:?}'", path),
|
||||
});
|
||||
dir_tests(&test_data_dir(), err_paths, "rast", |text, path| {
|
||||
if f(text).is_ok() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue