MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / remove_dir

Method remove_dir

src/pglite/sync_host_fs.rs:86–99  ·  view source on GitHub ↗
(&self, path: &Path)

Source from the content-addressed store, hash-verified

84 }
85
86 fn remove_dir(&self, path: &Path) -> virtual_fs::Result<()> {
87 let path = self.prepare_path(path)?;
88 if path.parent().is_none() {
89 return Err(FsError::BaseNotDirectory);
90 }
91 if path.is_dir()
92 && fs::read_dir(&path)
93 .map(|mut entries| entries.next().is_some())
94 .unwrap_or(false)
95 {
96 return Err(FsError::DirectoryNotEmpty);
97 }
98 fs::remove_dir(path).map_err(FsError::from)
99 }
100
101 fn rename<'a>(
102 &'a self,

Callers

nothing calls this directly

Calls 1

prepare_pathMethod · 0.80

Tested by

no test coverage detected