mirror of
https://github.com/guilhermewerner/mini-redis
synced 2025-06-15 14:35:13 +00:00
17 lines
391 B
Rust
17 lines
391 B
Rust
#![allow(non_snake_case)]
|
|
|
|
use tokio::fs::File;
|
|
use tokio::io::{self, AsyncWriteExt};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> io::Result<()> {
|
|
let mut file = File::create("File.txt").await?;
|
|
|
|
// Writes some prefix of the byte string, but not necessarily all of it.
|
|
let n = file.write(b"some bytes").await?;
|
|
|
|
println!("Wrote the first {} bytes of 'some bytes'.", n);
|
|
|
|
Ok(())
|
|
}
|