mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
Stablize pin feature (#814)
Box::pinned has been renamed to Box::pin. Meanwhile, the pin feature no longer requires an attribute to enable. Fixes: #813
This commit is contained in:
parent
c8a990eda4
commit
03e2e864f3
@ -8,7 +8,8 @@ guarantees. You are living on the edge here.**
|
||||
|
||||
## Usage
|
||||
|
||||
To use this crate, you need to start with a Rust 2018 edition crate.
|
||||
To use this crate, you need to start with a Rust 2018 edition crate, with rustc
|
||||
1.33.0-nightly or later.
|
||||
|
||||
Add this to your `Cargo.toml`:
|
||||
|
||||
|
@ -19,7 +19,7 @@ pub struct Compat<T>(Pin<Box<T>>);
|
||||
impl<T> Compat<T> {
|
||||
/// Create a new `Compat` backed by `future`.
|
||||
pub fn new(future: T) -> Compat<T> {
|
||||
Compat(Box::pinned(future))
|
||||
Compat(Box::pin(future))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
async_await,
|
||||
await_macro,
|
||||
futures_api,
|
||||
pin,
|
||||
)]
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/tokio-async-await/0.1.4")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user