mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 15:27:57 +00:00
Simplify some Option / Result / ? operator patterns (#8653)
* Simplify some Option / Result / ? operator patterns When those match a combinator exactly. Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust). * adjust after review * adjust post-review
This commit is contained in:
committed by
GitHub
parent
541692c4a8
commit
052be8bbef
@@ -51,19 +51,18 @@ impl StorageChangeSet {
|
||||
.map(move |(k,v)| (None, k, v.as_ref()));
|
||||
let children = self.child_changes
|
||||
.iter()
|
||||
.filter_map(move |(sk, changes)| {
|
||||
if let Some(cf) = self.child_filters.as_ref() {
|
||||
if let Some(filter) = cf.get(sk) {
|
||||
Some(changes
|
||||
.filter_map(move |(sk, changes)|
|
||||
self.child_filters.as_ref().and_then(|cf|
|
||||
cf.get(sk).map(|filter| changes
|
||||
.iter()
|
||||
.filter(move |&(key, _)| match filter {
|
||||
Some(ref filter) => filter.contains(key),
|
||||
None => true,
|
||||
})
|
||||
.map(move |(k,v)| (Some(sk), k, v.as_ref())))
|
||||
} else { None }
|
||||
} else { None }
|
||||
})
|
||||
.map(move |(k,v)| (Some(sk), k, v.as_ref()))
|
||||
)
|
||||
)
|
||||
)
|
||||
.flatten();
|
||||
top.chain(children)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user