Auto merge of #29123 - michaelgrigoryan25:master, r=jdm

Replaced explicit Default implementation for Seed with derive.

<!-- Please describe your changes on the following line: -->
This patch replaces the explicit `std::default::Default` implementation of the [Seed](https://github.com/servo/servo/blob/master/components/rand/lib.rs) struct with a derive macro.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [x] These changes do not require tests.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2022-12-01 22:51:30 -05:00 committed by GitHub
commit 495846f306
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,14 +63,9 @@ impl RngCore for ServoRng {
} }
} }
#[derive(Default)]
pub struct Seed([u8; 32]); pub struct Seed([u8; 32]);
impl Default for Seed {
fn default() -> Self {
Seed([0; 32])
}
}
impl AsMut<[u8]> for Seed { impl AsMut<[u8]> for Seed {
fn as_mut(&mut self) -> &mut [u8] { fn as_mut(&mut self) -> &mut [u8] {
&mut self.0 &mut self.0