We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
writeln
1 parent 457e7c1 commit 606318fCopy full SHA for 606318f
examples/rand.rs
@@ -7,14 +7,10 @@ fn main() {
7
let mut stdout = wasi::cli::stdout::get_stdout();
8
9
let r: u64 = HostRng.gen();
10
- stdout
11
- .write_all(format!("Cryptographically-secure random u64 is {r}\n").as_bytes())
12
- .unwrap();
+ writeln!(stdout, "Cryptographically-secure random u64 is {r}").unwrap();
13
14
let r: u64 = HostInsecureRng.gen();
15
16
- .write_all(format!("Pseudo-random u64 is {r}\n").as_bytes())
17
+ writeln!(stdout, "Pseudo-random u64 is {r}").unwrap();
18
19
stdout.flush().unwrap();
20
}
0 commit comments