INNER CODE UNIT · Rust
mapping
XayahSuSuSu/Android-DataBackup · source-next/native/src/main/jni/rustic/src/mapped_source.rs:310
fn mapping(&self, source: &str, target: &str) -> SourceMapping {
SourceMapping {
source_path: self.0.join(source).to_string_lossy().into_owned(),
snapshot_path: target.into(),
}
}
}
impl Drop for Workspace {
fn drop(&mut self) {
let _ = std::fs::remove_dir_all(&self.0);
}
}
fn contents(source: &MappedSource) -> BTreeMap<String, String> {
let entries = source.entries().collect::<RusticResult<Vec<_>>>().unwrap();
assert!(entries.windows(2).all(|pair| pair[0].path <= pair[1].path));
entries
.into_iter()