chore: change and_then to map based on clippy suggestion ♻️

This commit is contained in:
Dheepak Krishnamurthy 2022-02-18 18:23:45 -07:00
parent 73ff6cbe39
commit 6ec344897a

View file

@ -170,10 +170,7 @@ impl CompletionList {
}
pub fn selected(&self) -> Option<(usize, Completion)> {
self.state
.selected()
.and_then(|i| self.get(i))
.and_then(|s| Some((self.pos, s)))
self.state.selected().and_then(|i| self.get(i)).map(|s| (self.pos, s))
}
pub fn is_empty(&self) -> bool {