tokio-xmpp: Bump rand to 0.9
This commit is contained in:
parent
4f270bff7a
commit
c11075d1d4
4 changed files with 4 additions and 9 deletions
|
|
@ -20,7 +20,7 @@ tokio-stream = { version = "0.1", features = ["sync"] }
|
||||||
webpki-roots = { version = "0.26", optional = true }
|
webpki-roots = { version = "0.26", optional = true }
|
||||||
rustls-native-certs = { version = "0.7", optional = true }
|
rustls-native-certs = { version = "0.7", optional = true }
|
||||||
rxml = { version = "0.13.1", features = ["compact_str"] }
|
rxml = { version = "0.13.1", features = ["compact_str"] }
|
||||||
rand = "0.8"
|
rand = "0.9"
|
||||||
syntect = { version = "5", optional = true }
|
syntect = { version = "5", optional = true }
|
||||||
pin-project-lite = { version = "0.2" }
|
pin-project-lite = { version = "0.2" }
|
||||||
# same repository dependencies
|
# same repository dependencies
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@ use core::time::Duration;
|
||||||
use std::env::args;
|
use std::env::args;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
|
|
||||||
use rand::{thread_rng, Rng};
|
|
||||||
|
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
|
||||||
#[cfg(feature = "rustls-any-backend")]
|
#[cfg(feature = "rustls-any-backend")]
|
||||||
|
|
@ -76,7 +74,7 @@ async fn main() {
|
||||||
);
|
);
|
||||||
let domain: Jid = jid.domain().to_owned().into();
|
let domain: Jid = jid.domain().to_owned().into();
|
||||||
let mut ping_timer = tokio::time::interval(Duration::new(5, 0));
|
let mut ping_timer = tokio::time::interval(Duration::new(5, 0));
|
||||||
let mut ping_ctr: u64 = thread_rng().gen();
|
let mut ping_ctr: u64 = rand::random();
|
||||||
let signal = tokio::signal::ctrl_c();
|
let signal = tokio::signal::ctrl_c();
|
||||||
tokio::pin!(signal);
|
tokio::pin!(signal);
|
||||||
loop {
|
loop {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use rand::{thread_rng, Rng};
|
|
||||||
use xmpp_parsers::{
|
use xmpp_parsers::{
|
||||||
iq::Iq,
|
iq::Iq,
|
||||||
jid::Jid,
|
jid::Jid,
|
||||||
|
|
@ -17,7 +16,7 @@ use crate::xmlstream::XmppStreamElement;
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
|
|
||||||
pub(crate) fn make_id() -> String {
|
pub(crate) fn make_id() -> String {
|
||||||
let id: u64 = thread_rng().gen();
|
let id: u64 = rand::random();
|
||||||
format!("{}", id)
|
format!("{}", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,6 @@ use core::task::{Context, Poll};
|
||||||
use core::time::Duration;
|
use core::time::Duration;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use rand::{thread_rng, Rng};
|
|
||||||
|
|
||||||
use futures::{ready, SinkExt, StreamExt};
|
use futures::{ready, SinkExt, StreamExt};
|
||||||
|
|
||||||
use tokio::{
|
use tokio::{
|
||||||
|
|
@ -472,7 +470,7 @@ impl StanzaStreamWorker {
|
||||||
// from RFC 6120.
|
// from RFC 6120.
|
||||||
// NOTE: we use a random starting value here to avoid clashes with
|
// NOTE: we use a random starting value here to avoid clashes with
|
||||||
// other application code.
|
// other application code.
|
||||||
let mut ping_probe_ctr: u64 = thread_rng().gen();
|
let mut ping_probe_ctr: u64 = rand::random();
|
||||||
|
|
||||||
// We use mpsc::Sender permits (check the docs on
|
// We use mpsc::Sender permits (check the docs on
|
||||||
// [`tokio::sync::mpsc::Sender::reserve`]) as a way to avoid blocking
|
// [`tokio::sync::mpsc::Sender::reserve`]) as a way to avoid blocking
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue