From 7423a1d767171c316928f5c305898ebb6339f2a2 Mon Sep 17 00:00:00 2001 From: Levente Kurusa Date: Tue, 11 Apr 2023 21:01:31 +0200 Subject: [PATCH] format + lint Signed-off-by: Levente Kurusa --- ext/node/crypto/mod.rs | 3 ++- ext/node/polyfills/internal/crypto/_randomFill.ts | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ext/node/crypto/mod.rs b/ext/node/crypto/mod.rs index a4afcc4bce06fd..5f3d2f1f5bff2a 100644 --- a/ext/node/crypto/mod.rs +++ b/ext/node/crypto/mod.rs @@ -9,7 +9,8 @@ use deno_core::StringOrBuffer; use deno_core::ZeroCopyBuf; use hkdf::Hkdf; use num_bigint::BigInt; -use rand::distributions::{Distribution, Uniform}; +use rand::distributions::Distribution; +use rand::distributions::Uniform; use rand::Rng; use std::future::Future; use std::rc::Rc; diff --git a/ext/node/polyfills/internal/crypto/_randomFill.ts b/ext/node/polyfills/internal/crypto/_randomFill.ts index f99e411a4fa698..2cb39563a3fc3e 100644 --- a/ext/node/polyfills/internal/crypto/_randomFill.ts +++ b/ext/node/polyfills/internal/crypto/_randomFill.ts @@ -64,13 +64,14 @@ export default function randomFill( assertOffset(offset as number, buf.length); assertSize(size as number, offset as number, buf.length); - core.opAsync("op_node_generate_secret_async", Math.floor(size as number)).then( - (randomData: Uint8Array) => { - const randomBuf = Buffer.from(randomData.buffer); - randomBuf.copy(buf, offset as number, 0, size as number); - cb!(null, buf); - }, - ); + core.opAsync("op_node_generate_secret_async", Math.floor(size as number)) + .then( + (randomData: Uint8Array) => { + const randomBuf = Buffer.from(randomData.buffer); + randomBuf.copy(buf, offset as number, 0, size as number); + cb!(null, buf); + }, + ); } export function randomFillSync(buf: Buffer, offset = 0, size?: number) {