Skip to content

Commit cef15be

Browse files
add + Send for open result (#5)
1 parent 847d820 commit cef15be

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

async-vfs-os/src/os.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ impl Vfs for OsFs {
183183
Ok(fs::rename(self.get_real_path(from)?, self.get_real_path(to)?).await?)
184184
}
185185

186-
async fn open(&self, path: &str, options: OpenOptions) -> VfsResult<Pin<Box<dyn VFile>>> {
186+
async fn open(
187+
&self,
188+
path: &str,
189+
options: OpenOptions,
190+
) -> VfsResult<Pin<Box<dyn VFile + Send>>> {
187191
let raw_path = self.get_real_path(path)?;
188192

189193
let file = fs::OpenOptions::new()

async-vfs/src/vfs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub trait Vfs: Sync + Send {
3737
async fn metadata(&self, path: &str) -> VfsResult<Box<dyn VMetadata>>;
3838
async fn mkdir(&self, path: &str) -> VfsResult<()>;
3939
async fn mv(&self, from: &str, to: &str) -> VfsResult<()>;
40-
async fn open(&self, path: &str, options: OpenOptions) -> VfsResult<Pin<Box<dyn VFile>>>;
40+
async fn open(&self, path: &str, options: OpenOptions)
41+
-> VfsResult<Pin<Box<dyn VFile + Send>>>;
4142
async fn rm(&self, path: &str) -> VfsResult<()>;
4243
}

0 commit comments

Comments
 (0)