Deprecated std::task::ready re-export (#451)

This commit is contained in:
Nikolay Kim 2024-11-02 18:12:21 +05:00 committed by GitHub
parent 8288fc0364
commit a30147120d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 13 additions and 11 deletions

View file

@ -18,7 +18,7 @@ path = "src/lib.rs"
[dependencies]
ntex-codec = "0.6"
ntex-bytes = "0.1"
ntex-util = "2.3"
ntex-util = "2.5"
ntex-service = "3"
bitflags = "2"

View file

@ -1,10 +1,11 @@
//! Framed transport dispatcher
#![allow(clippy::let_underscore_future)]
use std::{cell::Cell, future::Future, pin::Pin, rc::Rc, task::Context, task::Poll};
use std::task::{ready, Context, Poll};
use std::{cell::Cell, future::Future, pin::Pin, rc::Rc};
use ntex_codec::{Decoder, Encoder};
use ntex_service::{IntoService, Pipeline, PipelineBinding, PipelineCall, Service};
use ntex_util::{future::Either, ready, spawn, time::Seconds};
use ntex_util::{future::Either, spawn, time::Seconds};
use crate::{Decoded, DispatchItem, IoBoxed, IoStatusUpdate, RecvError};

View file

@ -1,4 +1,4 @@
use std::task::{Context, Poll};
use std::task::{ready, Context, Poll};
use std::{any, cell::RefCell, cmp, future::poll_fn, io, mem, pin::Pin, rc::Rc, rc::Weak};
use ntex_bytes::{Buf, BufMut, BytesVec};
@ -6,7 +6,7 @@ use ntex_io::{
types, Filter, Handle, Io, IoBoxed, IoStream, ReadContext, WriteContext,
WriteContextBuf,
};
use ntex_util::{ready, time::Millis};
use ntex_util::time::Millis;
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
use tokio::net::TcpStream;

View file

@ -2,6 +2,7 @@
#![deny(rust_2018_idioms, unreachable_pub, missing_debug_implementations)]
#[doc(hidden)]
#[deprecated]
pub use std::task::ready;
pub mod channel;

View file

@ -102,10 +102,6 @@ impl CounterInner {
fn available(&self, cx: &mut task::Context<'_>) -> bool {
self.task.register(cx.waker());
if self.count.get() < self.capacity {
true
} else {
false
}
self.count.get() < self.capacity
}
}

View file

@ -118,5 +118,9 @@ pub mod util {
pub use ntex_bytes::{
Buf, BufMut, ByteString, Bytes, BytesMut, BytesVec, Pool, PoolId, PoolRef,
};
pub use ntex_util::{future::*, ready, services::*, HashMap, HashSet};
pub use ntex_util::{future::*, services::*, HashMap, HashSet};
#[doc(hidden)]
#[deprecated]
pub use std::task::ready;
}