Use Option::map instead of open coding it
This commit is contained in:
parent
c643dd2ec8
commit
cd8973250d
3 changed files with 8 additions and 12 deletions
|
@ -1106,10 +1106,7 @@ impl<T> Binder<T> {
|
|||
|
||||
impl<T> Binder<Option<T>> {
|
||||
pub fn transpose(self) -> Option<Binder<T>> {
|
||||
match self.0 {
|
||||
Some(v) => Some(Binder(v)),
|
||||
None => None,
|
||||
}
|
||||
self.0.map(Binder)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue