summaryrefslogtreecommitdiff
path: root/ext/fs/interface.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fs/interface.rs')
-rw-r--r--ext/fs/interface.rs58
1 files changed, 0 insertions, 58 deletions
diff --git a/ext/fs/interface.rs b/ext/fs/interface.rs
index 09e16aff1..af4beb248 100644
--- a/ext/fs/interface.rs
+++ b/ext/fs/interface.rs
@@ -337,64 +337,6 @@ pub trait FileSystem: std::fmt::Debug + MaybeSend + MaybeSync {
}
}
-pub struct DenoConfigFsAdapter<'a>(&'a dyn FileSystem);
-
-impl<'a> DenoConfigFsAdapter<'a> {
- pub fn new(fs: &'a dyn FileSystem) -> Self {
- Self(fs)
- }
-}
-
-impl<'a> deno_config::fs::DenoConfigFs for DenoConfigFsAdapter<'a> {
- fn read_to_string_lossy(
- &self,
- path: &Path,
- ) -> Result<String, std::io::Error> {
- self
- .0
- .read_text_file_lossy_sync(path, None)
- .map_err(|err| err.into_io_error())
- }
-
- fn stat_sync(
- &self,
- path: &Path,
- ) -> Result<deno_config::fs::FsMetadata, std::io::Error> {
- self
- .0
- .stat_sync(path)
- .map(|stat| deno_config::fs::FsMetadata {
- is_file: stat.is_file,
- is_directory: stat.is_directory,
- is_symlink: stat.is_symlink,
- })
- .map_err(|err| err.into_io_error())
- }
-
- fn read_dir(
- &self,
- path: &Path,
- ) -> Result<Vec<deno_config::fs::FsDirEntry>, std::io::Error> {
- self
- .0
- .read_dir_sync(path)
- .map_err(|err| err.into_io_error())
- .map(|entries| {
- entries
- .into_iter()
- .map(|e| deno_config::fs::FsDirEntry {
- path: path.join(e.name),
- metadata: deno_config::fs::FsMetadata {
- is_file: e.is_file,
- is_directory: e.is_directory,
- is_symlink: e.is_symlink,
- },
- })
- .collect()
- })
- }
-}
-
// Like String::from_utf8_lossy but operates on owned values
#[inline(always)]
fn string_from_utf8_lossy(buf: Vec<u8>) -> String {