Skip to content

Commit

Permalink
Fix fs
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Mar 11, 2024
1 parent 11d20d2 commit 30a617b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions bindings/python/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use std::io::Write;
use std::ops::DerefMut;
use std::sync::Arc;

use futures::AsyncReadExt;
use futures::AsyncSeekExt;
use futures::AsyncWriteExt;
use pyo3::exceptions::PyIOError;
Expand Down Expand Up @@ -243,12 +242,11 @@ impl AsyncFile {

let buffer = match size {
Some(size) => {
let mut buffer = vec![0; size];
reader
.read_exact(&mut buffer)
let buffer = reader
.read_exact(size)
.await
.map_err(|err| PyIOError::new_err(err.to_string()))?;
buffer
buffer.to_vec()
}
None => {
let mut buffer = Vec::new();
Expand Down

0 comments on commit 30a617b

Please sign in to comment.