Removes unnecessary default() (#32477)

This commit is contained in:
Brooks 2023-07-13 13:59:57 -04:00 committed by GitHub
parent 60130fdd75
commit 3b0e4c8452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 12 deletions

View File

@ -69,7 +69,7 @@ impl<T: BloomHashIndex> Bloom<T> {
keys,
bits,
num_bits_set: 0,
_phantom: PhantomData::default(),
_phantom: PhantomData,
}
}
/// Create filter optimal for num size given the `FALSE_RATE`.
@ -157,7 +157,7 @@ impl<T: BloomHashIndex> From<Bloom<T>> for AtomicBloom<T> {
.iter()
.map(|&x| AtomicU64::new(x))
.collect(),
_phantom: PhantomData::default(),
_phantom: PhantomData,
}
}
}
@ -215,7 +215,7 @@ impl<T: BloomHashIndex> From<AtomicBloom<T>> for Bloom<T> {
keys: atomic_bloom.keys,
bits,
num_bits_set,
_phantom: PhantomData::default(),
_phantom: PhantomData,
}
}
}

View File

@ -32,7 +32,7 @@ impl<const K: usize, T: ?Sized + Hash> Deduper<K, T> {
clock: Instant::now(),
bits: repeat_with(AtomicU64::default).take(size).collect(),
popcount: AtomicU64::default(),
_phantom: PhantomData::<T>::default(),
_phantom: PhantomData::<T>,
}
}

View File

@ -402,7 +402,7 @@ where
&SerializableBankAndStorage::<newer::Context> {
bank,
snapshot_storages,
phantom: std::marker::PhantomData::default(),
phantom: std::marker::PhantomData,
},
),
}
@ -424,7 +424,7 @@ where
&SerializableBankAndStorageNoExtra::<newer::Context> {
bank,
snapshot_storages,
phantom: std::marker::PhantomData::default(),
phantom: std::marker::PhantomData,
},
),
}

View File

@ -211,7 +211,7 @@ impl<'a> TypeContext<'a> for Context {
accounts_db: &serializable_bank.bank.rc.accounts.accounts_db,
slot: serializable_bank.bank.rc.slot,
account_storage_entries: serializable_bank.snapshot_storages,
phantom: std::marker::PhantomData::default(),
phantom: std::marker::PhantomData,
},
// Additional fields, we manually store the lamps per signature here so that
// we can grab it on restart.
@ -245,7 +245,7 @@ impl<'a> TypeContext<'a> for Context {
accounts_db: &serializable_bank.bank.rc.accounts.accounts_db,
slot: serializable_bank.bank.rc.slot,
account_storage_entries: serializable_bank.snapshot_storages,
phantom: std::marker::PhantomData::default(),
phantom: std::marker::PhantomData,
},
)
.serialize(serializer)

View File

@ -166,7 +166,7 @@ where
accounts_db,
slot,
account_storage_entries,
phantom: std::marker::PhantomData::default(),
phantom: std::marker::PhantomData,
},
),
}

View File

@ -44,7 +44,7 @@ pub mod solana_rpc_client {
&self,
_transaction: &Transaction,
) -> ClientResult<Signature> {
Ok(Signature::default())
Ok(Signature)
}
pub fn get_minimum_balance_for_rent_exemption(

View File

@ -58,7 +58,7 @@ where
deserializer.deserialize_tuple(
(std::mem::size_of::<T>() * 8 + 6) / 7,
VarIntVisitor {
phantom: PhantomData::default(),
phantom: PhantomData,
},
)
}

View File

@ -35,7 +35,7 @@ impl Keypair {
/// Constructs a new, random `Keypair` using `OsRng`
pub fn new() -> Self {
let mut rng = OsRng::default();
let mut rng = OsRng;
Self::generate(&mut rng)
}