Skip to content

Commit

Permalink
Removes unnecessary default() (solana-labs#32477)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Jul 13, 2023
1 parent 60130fd commit 3b0e4c8
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions bloom/src/bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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,
}
}
}
Expand Down Expand Up @@ -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,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion perf/src/deduper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
}
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/serde_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ where
&SerializableBankAndStorage::<newer::Context> {
bank,
snapshot_storages,
phantom: std::marker::PhantomData::default(),
phantom: std::marker::PhantomData,
},
),
}
Expand All @@ -424,7 +424,7 @@ where
&SerializableBankAndStorageNoExtra::<newer::Context> {
bank,
snapshot_storages,
phantom: std::marker::PhantomData::default(),
phantom: std::marker::PhantomData,
},
),
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/src/serde_snapshot/newer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/serde_snapshot/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ where
accounts_db,
slot,
account_storage_entries,
phantom: std::marker::PhantomData::default(),
phantom: std::marker::PhantomData,
},
),
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/program/src/example_mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion sdk/program/src/serde_varint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ where
deserializer.deserialize_tuple(
(std::mem::size_of::<T>() * 8 + 6) / 7,
VarIntVisitor {
phantom: PhantomData::default(),
phantom: PhantomData,
},
)
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/signer/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 3b0e4c8

Please sign in to comment.