Replace if let with match where appropriate

This commit is contained in:
Aramis Razzaghipour 2021-10-03 23:53:01 +11:00
parent f29796da61
commit 9583dd5725
No known key found for this signature in database
GPG key ID: F788F7E990136003
44 changed files with 201 additions and 269 deletions

View file

@ -205,10 +205,9 @@ impl<'a> Cursor<'a> {
/// Bump the cursor
pub fn bump(self) -> Cursor<'a> {
if let Some(Entry::End(exit)) = self.buffer.entry(&self.ptr) {
if let Some(exit) = exit {
Cursor::create(self.buffer, *exit)
} else {
self
match exit {
Some(exit) => Cursor::create(self.buffer, *exit),
None => self,
}
} else {
Cursor::create(self.buffer, EntryPtr(self.ptr.0, self.ptr.1 + 1))