mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Remove unsafe from clone
This commit is contained in:
parent
925baced46
commit
82855ac66b
|
@ -156,18 +156,12 @@ where
|
||||||
V: Clone,
|
V: Clone,
|
||||||
{
|
{
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
if self.has_value() {
|
if let Some((k, v)) = self.key_value_ref() {
|
||||||
Self {
|
Self {
|
||||||
hash: self.hash,
|
hash: self.hash,
|
||||||
distance_to_initial_bucket: self.distance_to_initial_bucket,
|
distance_to_initial_bucket: self.distance_to_initial_bucket,
|
||||||
key: MaybeUninit::new(
|
key: MaybeUninit::new(k.clone()),
|
||||||
// SAFETY: has a value
|
value: MaybeUninit::new(v.clone()),
|
||||||
unsafe { self.key.assume_init_ref() }.clone(),
|
|
||||||
),
|
|
||||||
value: MaybeUninit::new(
|
|
||||||
// SAFETY: has a value
|
|
||||||
unsafe { self.value.assume_init_ref() }.clone(),
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Self {
|
Self {
|
||||||
|
|
Loading…
Reference in a new issue