mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-23 12:46:43 +00:00
dev: drop if_chain and collapse if statements (#2097)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This commit is contained in:
parent
1c9db1ce69
commit
ce447185d1
42 changed files with 520 additions and 545 deletions
|
|
@ -251,20 +251,20 @@ fn match_by_pos(mut n: LinkedNode, prev: bool, ident: bool) -> usize {
|
|||
match n.kind() {
|
||||
SyntaxKind::Closure => {
|
||||
let closure = n.cast::<ast::Closure>().unwrap();
|
||||
if let Some(name) = closure.name() {
|
||||
if let Some(m) = n.find(name.span()) {
|
||||
n = m;
|
||||
break 'match_loop;
|
||||
}
|
||||
if let Some(name) = closure.name()
|
||||
&& let Some(m) = n.find(name.span())
|
||||
{
|
||||
n = m;
|
||||
break 'match_loop;
|
||||
}
|
||||
}
|
||||
SyntaxKind::LetBinding => {
|
||||
let let_binding = n.cast::<ast::LetBinding>().unwrap();
|
||||
if let Some(name) = let_binding.kind().bindings().first() {
|
||||
if let Some(m) = n.find(name.span()) {
|
||||
n = m;
|
||||
break 'match_loop;
|
||||
}
|
||||
if let Some(name) = let_binding.kind().bindings().first()
|
||||
&& let Some(m) = n.find(name.span())
|
||||
{
|
||||
n = m;
|
||||
break 'match_loop;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue