Skip to content

Commit 5bd7296

Browse files
committed
review: use getrandom:fill inline to improve readability.
Signed-off-by: Piotr Sikora <[email protected]>
1 parent b8542e0 commit 5bd7296

File tree

1 file changed

+1
-4
lines changed
  • examples/hello_world/src

1 file changed

+1
-4
lines changed

examples/hello_world/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ use proxy_wasm::traits::*;
1919
use proxy_wasm::types::*;
2020
use std::time::Duration;
2121

22-
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
23-
use getrandom::fill;
24-
2522
proxy_wasm::main! {{
2623
proxy_wasm::set_log_level(LogLevel::Trace);
2724
proxy_wasm::set_root_context(|_| -> Box<dyn RootContext> { Box::new(HelloWorld) });
@@ -47,7 +44,7 @@ impl RootContext for HelloWorld {
4744
} else {
4845
let now: DateTime<Utc> = Utc::now();
4946
let mut buf = [0u8; 1];
50-
fill(&mut buf).unwrap();
47+
getrandom::fill(&mut buf).unwrap();
5148
info!("It's {}, your lucky number is {}.", now, buf[0]);
5249
}
5350
}

0 commit comments

Comments
 (0)