~icefox/public-inbox

[PATCH oorandom] Small correction to the usage example

Details
Message ID
<9f29e023c2ae718ed63d.1589949339@vitorhnn-arch64>
DKIM signature
pass
Download raw message
# HG changeset patch
# User Victor Chiletto <v@hnn.net.br>
# Date 1589948799 10800
#      Wed May 20 01:26:39 2020 -0300
# Node ID 9f29e023c2ae718ed63d94c7ae78195c91ffd8c4
# Parent  46f4eae51bf7bc46d3ac558fcef0508165d8bd75
Small correction to the usage example

rng_float takes &mut self, which generates a compiler scream when rng is not mut

diff -r 46f4eae51bf7 -r 9f29e023c2ae README.md
--- a/README.md	Sat May 02 00:54:01 2020 -0400
+++ b/README.md	Wed May 20 01:26:39 2020 -0300
@@ -53,7 +53,7 @@
 ```rust
 use oorandom;
 fn main() {
-    let rng = oorandom::Rand32::new(some_seed);
+    let mut rng = oorandom::Rand32::new(some_seed);
     println!("Your random number is: {}", rng.rand_float());
 }
 ```
Reply to thread Export thread (mbox)