fix: make stats args global (#2610)

This commit is contained in:
Matthias Seitz
2023-05-09 00:08:48 +02:00
committed by GitHub
parent 38d9bca8f1
commit 0850bfaf0a
2 changed files with 25 additions and 2 deletions

View File

@ -190,6 +190,16 @@ impl<D: XdgPath> MaybePlatformPath<D> {
)
}
/// Returns true if a custom path is set
pub fn is_some(&self) -> bool {
self.0.is_some()
}
/// Returns the path if it is set, otherwise returns `None`.
pub fn as_ref(&self) -> Option<&Path> {
self.0.as_ref().map(|p| p.as_ref())
}
/// Returns the path if it is set, otherwise returns the default path, without any chain
/// directory.
pub fn unwrap_or_default(&self) -> PlatformPath<D> {