libs: add RemotePath::strip_prefix

This commit is contained in:
John Spray
2023-09-04 14:59:26 +01:00
parent 3e09cabb6a
commit 6e0b977bc8

View File

@@ -111,6 +111,10 @@ impl RemotePath {
pub fn extension(&self) -> Option<&str> {
self.0.extension()?.to_str()
}
pub fn strip_prefix(&self, p: &RemotePath) -> Result<&Path, std::path::StripPrefixError> {
self.0.strip_prefix(&p.0)
}
}
/// Storage (potentially remote) API to manage its state.