mirror of
				https://github.com/async-rs/async-std.git
				synced 2025-10-31 16:56:38 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			355 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			355 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //! Fetches the HTML contents of the Rust website.
 | |
| 
 | |
| #![feature(async_await)]
 | |
| 
 | |
| use std::error::Error;
 | |
| 
 | |
| use async_std::task;
 | |
| 
 | |
| fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
 | |
|     task::block_on(async {
 | |
|         // let contents = surf::get("https://www.rust-lang.org").recv_string().await?;
 | |
|         // println!("{}", contents);
 | |
|         Ok(())
 | |
|     })
 | |
| }
 |