Skip to content

Commit c8b2335

Browse files
authored
Update getrandom to v0.3 in examples. (#302)
Signed-off-by: Piotr Sikora <[email protected]>
1 parent ae38c0f commit c8b2335

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Diff for: examples/hello_world/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ log = "0.4"
1717
proxy-wasm = { path = "../../" }
1818

1919
[target.'cfg(not(all(target_arch = "wasm32", target_os = "unknown")))'.dependencies]
20-
getrandom = "0.2"
20+
getrandom = "0.3"
2121

2222
[profile.release]
2323
lto = true

Diff for: examples/hello_world/src/lib.rs

+1-4
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::getrandom;
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-
getrandom(&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)