clippy: Use if lets and remove redundant returns
This commit is contained in:
@@ -30,7 +30,8 @@ pub fn find_leaf_at_offset(node: SyntaxNodeRef, offset: TextUnit) -> LeafAtOffse
|
||||
let left = children.next().unwrap();
|
||||
let right = children.next();
|
||||
assert!(children.next().is_none());
|
||||
return if let Some(right) = right {
|
||||
|
||||
if let Some(right) = right {
|
||||
match (
|
||||
find_leaf_at_offset(left, offset),
|
||||
find_leaf_at_offset(right, offset),
|
||||
@@ -42,7 +43,7 @@ pub fn find_leaf_at_offset(node: SyntaxNodeRef, offset: TextUnit) -> LeafAtOffse
|
||||
}
|
||||
} else {
|
||||
find_leaf_at_offset(left, offset)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
|
||||
Reference in New Issue
Block a user