FileEngine: expose native file types on different platforms (#1258)

* Get native file

* Correct visibility
This commit is contained in:
wooden-worm authored and GitHub committed 2023-08-17 08:03:56 -05:00
1 parent fa39408d58
commit f652474a6e
4 files changed
+40 -1

No files matched your search

@@ -1,3 +1,4 @@
use std::any::Any;
use std::path::PathBuf;
use crate::FileEngine;
@@ -40,4 +41,9 @@ impl FileEngine for NativeFileEngine {
Some(contents)
}
async fn get_native_file(&self, file: &str) -> Option<Box<dyn Any>> {
let file = File::open(file).await.ok()?;
Some(Box::new(file))
}
}