From 83b41fdbf07c65ae60e5fca10e98eeb687bdff5d Mon Sep 17 00:00:00 2001 From: michaelgrigoryan25 <56165400+michaelgrigoryan25@users.noreply.github.com> Date: Thu, 1 Dec 2022 18:21:54 +0400 Subject: [PATCH 1/2] Replaced explicit Default implementation for Seed with derive. --- components/rand/lib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/rand/lib.rs b/components/rand/lib.rs index d9a8765c993..e8ed951d34f 100644 --- a/components/rand/lib.rs +++ b/components/rand/lib.rs @@ -63,13 +63,14 @@ impl RngCore for ServoRng { } } +#[derive(Default)] pub struct Seed([u8; 32]); -impl Default for Seed { - fn default() -> Self { - Seed([0; 32]) - } -} +// impl Default for Seed { +// fn default() -> Self { +// Seed([0; 32]) +// } +// } impl AsMut<[u8]> for Seed { fn as_mut(&mut self) -> &mut [u8] { From 269da66cfbc5d6635b42acb1ac7eef31734f583c Mon Sep 17 00:00:00 2001 From: michaelgrigoryan25 <56165400+michaelgrigoryan25@users.noreply.github.com> Date: Thu, 1 Dec 2022 18:27:59 +0400 Subject: [PATCH 2/2] Removed the commented code. --- components/rand/lib.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/rand/lib.rs b/components/rand/lib.rs index e8ed951d34f..4ea2b6e004a 100644 --- a/components/rand/lib.rs +++ b/components/rand/lib.rs @@ -66,12 +66,6 @@ impl RngCore for ServoRng { #[derive(Default)] pub struct Seed([u8; 32]); -// impl Default for Seed { -// fn default() -> Self { -// Seed([0; 32]) -// } -// } - impl AsMut<[u8]> for Seed { fn as_mut(&mut self) -> &mut [u8] { &mut self.0