Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed May 6, 2024
1 parent 3391b7e commit 0cc69d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions communities/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub mod v2 {
impl<T: Config + frame_system::Config> OnRuntimeUpgrade for MigrateV0orV1toV2<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::DispatchError> {
let current_version = Pallet::<T>::current_storage_version();
let current_version = Pallet::<T>::in_code_storage_version();
let onchain_version = Pallet::<T>::on_chain_storage_version();
ensure!(
onchain_version < 2 && current_version == 2,
Expand All @@ -180,7 +180,7 @@ pub mod v2 {
count <= T::MaxCommunityIdentifiersPerGeohash::get(),
"too many cids per geohash"
);
cids_by_geohash_count = cids_by_geohash_count + count;
cids_by_geohash_count += count;
}
log::info!(
target: TARGET,
Expand All @@ -196,7 +196,7 @@ pub mod v2 {
count <= T::MaxLocationsPerGeohash::get(),
"too many locations per geohash"
);
locations_by_geohash_count = locations_by_geohash_count + count;
locations_by_geohash_count += count;
}
log::info!(
target: TARGET,
Expand All @@ -209,7 +209,7 @@ pub mod v2 {
for bs in bootstrappers {
let count = bs.1.len() as u32;
ensure!(count <= T::MaxBootstrappers::get(), "too many bootstrappers");
bootstrappers_count = bootstrappers_count + count
bootstrappers_count += count
}
log::info!(target: TARGET, "{} bootstrappers will be migrated.", bootstrappers_count,);

Expand All @@ -229,7 +229,7 @@ pub mod v2 {
/// 0->1 was a noop as long as no values exceeded bounds
/// there is no problem if we enforce bounds again if the onchain_version is already v1
fn on_runtime_upgrade() -> Weight {
let current_version = Pallet::<T>::current_storage_version();
let current_version = Pallet::<T>::in_code_storage_version();
let onchain_version = Pallet::<T>::on_chain_storage_version();

log::info!(
Expand Down

0 comments on commit 0cc69d6

Please sign in to comment.