summaryrefslogtreecommitdiff
path: root/cli/ops/random.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/ops/random.rs')
-rw-r--r--cli/ops/random.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/ops/random.rs b/cli/ops/random.rs
index 874887cdb..b29c761b8 100644
--- a/cli/ops/random.rs
+++ b/cli/ops/random.rs
@@ -17,15 +17,15 @@ pub fn init(i: &mut CoreIsolate, s: &State) {
fn op_get_random_values(
state: &State,
_args: Value,
- zero_copy: Option<ZeroCopyBuf>,
+ zero_copy: &mut [ZeroCopyBuf],
) -> Result<JsonOp, OpError> {
- assert!(zero_copy.is_some());
+ assert_eq!(zero_copy.len(), 1);
if let Some(ref mut seeded_rng) = state.borrow_mut().seeded_rng {
- seeded_rng.fill(&mut zero_copy.unwrap()[..]);
+ seeded_rng.fill(&mut *zero_copy[0]);
} else {
let mut rng = thread_rng();
- rng.fill(&mut zero_copy.unwrap()[..]);
+ rng.fill(&mut *zero_copy[0]);
}
Ok(JsonOp::Sync(json!({})))