mirror of
https://github.com/guilhermewerner/mini-redis
synced 2025-06-15 14:35:13 +00:00
18 lines
348 B
Rust
18 lines
348 B
Rust
#![allow(non_snake_case)]
|
|
|
|
use tokio::fs::File;
|
|
use tokio::io::{self, AsyncReadExt};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> io::Result<()> {
|
|
let mut buffer = Vec::new();
|
|
let mut file = File::open("README.md").await?;
|
|
|
|
// read the whole file
|
|
file.read_to_end(&mut buffer).await?;
|
|
|
|
println!("The bytes: {:?}", &buffer);
|
|
|
|
Ok(())
|
|
}
|