Trying to fix rust compat
This commit is contained in:
parent
69a638fb81
commit
e5c11e778a
2 changed files with 14 additions and 15 deletions
|
|
@ -46,7 +46,7 @@ pub mod stats;
|
|||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
net::SocketAddr,
|
||||
num::NonZero,
|
||||
num::NonZeroU32,
|
||||
sync::{
|
||||
atomic::{AtomicBool, AtomicU64, Ordering},
|
||||
Arc,
|
||||
|
|
@ -418,12 +418,12 @@ impl TorrentStateLive {
|
|||
) -> anyhow::Result<()> {
|
||||
while let Some((tx, ci)) = rx.recv().await {
|
||||
self.ratelimits
|
||||
.prepare_for_upload(NonZero::new(ci.size).unwrap())
|
||||
.prepare_for_upload(NonZeroU32::new(ci.size).unwrap())
|
||||
.await?;
|
||||
if let Some(session) = self.torrent.session.upgrade() {
|
||||
session
|
||||
.ratelimits
|
||||
.prepare_for_upload(NonZero::new(ci.size).unwrap())
|
||||
.prepare_for_upload(NonZeroU32::new(ci.size).unwrap())
|
||||
.await?;
|
||||
}
|
||||
let _ = tx.send(WriterRequest::ReadChunkRequest(ci));
|
||||
|
|
@ -1449,13 +1449,13 @@ impl PeerHandler {
|
|||
|
||||
self.state
|
||||
.ratelimits
|
||||
.prepare_for_download(NonZero::new(request.length).unwrap())
|
||||
.prepare_for_download(NonZeroU32::new(request.length).unwrap())
|
||||
.await?;
|
||||
|
||||
if let Some(session) = self.state.torrent().session.upgrade() {
|
||||
session
|
||||
.ratelimits
|
||||
.prepare_for_download(NonZero::new(request.length).unwrap())
|
||||
.prepare_for_download(NonZeroU32::new(request.length).unwrap())
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue