mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +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
@@ -26,16 +26,12 @@ pub fn migrate<T: Config>() -> Weight {
|
||||
Some(version) if version == PalletVersion::new(3, 0, 0) => {
|
||||
weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1));
|
||||
let _ = <CurrentSchedule<T>>::translate::<u32, _>(|version| {
|
||||
if let Some(version) = version {
|
||||
Some(Schedule {
|
||||
version.map(|version| Schedule {
|
||||
version: version.saturating_add(1),
|
||||
// Default limits were not decreased. Therefore it is OK to overwrite
|
||||
// the schedule with the new defaults.
|
||||
.. Default::default()
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
}
|
||||
_ => (),
|
||||
|
||||
Reference in New Issue
Block a user