mirror of
https://github.com/guilhermewerner/mini-redis
synced 2025-06-15 14:35:13 +00:00
18 lines
355 B
Rust
18 lines
355 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 = [1; 10];
|
|
let mut file = File::open("README.md").await?;
|
|
|
|
// read up to 10 bytes
|
|
let n = file.read(&mut buffer[..]).await?;
|
|
|
|
println!("The bytes: {:?}", &buffer[..n]);
|
|
|
|
Ok(())
|
|
}
|