mirror of
				https://github.com/tokio-rs/tokio.git
				synced 2025-11-03 14:02:47 +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
 | 
					## 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`:
 | 
					Add this to your `Cargo.toml`:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,7 @@ pub struct Compat<T>(Pin<Box<T>>);
 | 
				
			|||||||
impl<T> Compat<T> {
 | 
					impl<T> Compat<T> {
 | 
				
			||||||
    /// Create a new `Compat` backed by `future`.
 | 
					    /// Create a new `Compat` backed by `future`.
 | 
				
			||||||
    pub fn new(future: T) -> Compat<T> {
 | 
					    pub fn new(future: T) -> Compat<T> {
 | 
				
			||||||
        Compat(Box::pinned(future))
 | 
					        Compat(Box::pin(future))
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,6 @@
 | 
				
			|||||||
    async_await,
 | 
					    async_await,
 | 
				
			||||||
    await_macro,
 | 
					    await_macro,
 | 
				
			||||||
    futures_api,
 | 
					    futures_api,
 | 
				
			||||||
    pin,
 | 
					 | 
				
			||||||
    )]
 | 
					    )]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#![doc(html_root_url = "https://docs.rs/tokio-async-await/0.1.4")]
 | 
					#![doc(html_root_url = "https://docs.rs/tokio-async-await/0.1.4")]
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user