@@ -12,7 +12,7 @@ use nom::{
1212 named,
1313 do_parse, map, call, take,
1414} ;
15- use rand:: { Rng , distributions:: { Distribution , Standard } } ;
15+ use rand:: { CryptoRng , Rng , distributions:: { Distribution , Standard } } ;
1616use cookie_factory:: { do_gen, gen_slice} ;
1717
1818use tox_binary_io:: * ;
@@ -178,7 +178,7 @@ impl ToxId {
178178 let _toxid = ToxId::new(&mut rng, pk);
179179 ```
180180 */
181- pub fn new < R : Rng > ( rng : & mut R , pk : PublicKey ) -> Self {
181+ pub fn new < R : Rng + CryptoRng > ( rng : & mut R , pk : PublicKey ) -> Self {
182182 let nospam = rng. gen ( ) ;
183183 let checksum = Self :: checksum ( & pk, nospam) ;
184184 ToxId { pk, nospam, checksum }
@@ -215,7 +215,7 @@ impl ToxId {
215215 */
216216 // TODO: more tests
217217 // TODO: ↓ split into `new_nospam()` and `set_nospam(NoSpam)` ?
218- pub fn new_nospam < R : Rng > ( & mut self , rng : & mut R , nospam : Option < NoSpam > ) {
218+ pub fn new_nospam < R : Rng + CryptoRng > ( & mut self , rng : & mut R , nospam : Option < NoSpam > ) {
219219 if let Some ( nospam) = nospam {
220220 self . nospam = nospam;
221221 } else {
0 commit comments