aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/subtlecrypto.rs
diff options
context:
space:
mode:
authorchickenleaf <lashwinib@gmail.com>2024-10-09 05:06:52 +0530
committerGitHub <noreply@github.com>2024-10-08 23:36:52 +0000
commit589f0d701845f10753881af6d827138bf0354b74 (patch)
tree0196540aed58ae64978052d993f1ed2d5d638aa0 /components/script/dom/subtlecrypto.rs
parent476ebb92fbf9cd5e54b778cbe853be8d87bc0d10 (diff)
downloadservo-589f0d701845f10753881af6d827138bf0354b74.tar.gz
servo-589f0d701845f10753881af6d827138bf0354b74.zip
Fix clippy warning: slow zero-filling initialization (#33740)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Diffstat (limited to 'components/script/dom/subtlecrypto.rs')
-rw-r--r--components/script/dom/subtlecrypto.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/script/dom/subtlecrypto.rs b/components/script/dom/subtlecrypto.rs
index 81291df87f4..0773af4a147 100644
--- a/components/script/dom/subtlecrypto.rs
+++ b/components/script/dom/subtlecrypto.rs
@@ -295,8 +295,7 @@ impl SubtleCrypto {
return Err(Error::Syntax);
}
- let mut rand = Vec::new();
- rand.resize(key_gen_params.length as usize, 0);
+ let mut rand = vec![0; key_gen_params.length as usize];
self.rng.borrow_mut().fill_bytes(&mut rand);
let handle = match key_gen_params.length {
128 => Handle::Aes128(rand),