mirror of
https://github.com/chatmail/core.git
synced 2026-04-25 01:16:29 +03:00
build: update rand to 0.9
We already have both rand 0.8 and rand 0.9 in our dependency tree. We still need rand 0.8 because public APIs of rPGP 0.17.0 and Iroh 0.35.0 use rand 0.8 types in public APIs, so it is imported as rand_old.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
//! # Key transfer via Autocrypt Setup Message.
|
||||
use std::io::BufReader;
|
||||
|
||||
use rand::{Rng, thread_rng};
|
||||
|
||||
use anyhow::{Result, bail, ensure};
|
||||
|
||||
use crate::blob::BlobObject;
|
||||
@@ -133,12 +131,11 @@ pub async fn render_setup_file(context: &Context, passphrase: &str) -> Result<St
|
||||
/// Creates a new setup code for Autocrypt Setup Message.
|
||||
fn create_setup_code(_context: &Context) -> String {
|
||||
let mut random_val: u16;
|
||||
let mut rng = thread_rng();
|
||||
let mut ret = String::new();
|
||||
|
||||
for i in 0..9 {
|
||||
loop {
|
||||
random_val = rng.r#gen();
|
||||
random_val = rand::random();
|
||||
if random_val as usize <= 60000 {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user