1
Fork 0

Rollup merge of #79337 - LingMan:map, r=jyn514

Use Option::map instead of open coding it

r?  `@jonas-schievink` since you're frequently sniping these minor cleanups anyway.
`@rustbot` modify labels +C-cleanup  +T-compiler
This commit is contained in:
Jonas Schievink 2020-11-23 15:25:53 +01:00 committed by GitHub
commit 064c3c146a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 12 deletions

View file

@ -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)
}
}