Skip to content

Commit

Permalink
fix: make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ho-229 committed Mar 25, 2024
1 parent e0967c3 commit c1013e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/ofs/tests/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ use tokio::{
io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt},
};

static TEST_TEXT: &'static str = include_str!("../Cargo.toml");
static TEST_TEXT: &str = include_str!("../Cargo.toml");

#[test_context(OfsTestContext)]
#[tokio::test]
async fn test_file(ctx: &mut OfsTestContext) {
let path = ctx.mount_point.path().join("test_file.txt");
let mut file = File::create(&path).await.unwrap();

file.write(TEST_TEXT.as_bytes()).await.unwrap();
file.write_all(TEST_TEXT.as_bytes()).await.unwrap();
drop(file);

let mut file = File::open(&path).await.unwrap();
Expand All @@ -53,11 +53,11 @@ async fn test_file_append(ctx: &mut OfsTestContext) {
let path = ctx.mount_point.path().join("test_file_append.txt");
let mut file = File::create(&path).await.unwrap();

file.write(TEST_TEXT.as_bytes()).await.unwrap();
file.write_all(TEST_TEXT.as_bytes()).await.unwrap();
drop(file);

let mut file = File::options().append(true).open(&path).await.unwrap();
file.write(b"test").await.unwrap();
file.write_all(b"test").await.unwrap();
drop(file);

let mut file = File::open(&path).await.unwrap();
Expand All @@ -75,7 +75,7 @@ async fn test_file_seek(ctx: &mut OfsTestContext) {
let path = ctx.mount_point.path().join("test_file_seek.txt");
let mut file = File::create(&path).await.unwrap();

file.write(TEST_TEXT.as_bytes()).await.unwrap();
file.write_all(TEST_TEXT.as_bytes()).await.unwrap();
drop(file);

let mut file = File::open(&path).await.unwrap();
Expand Down

0 comments on commit c1013e1

Please sign in to comment.