path-dedot 4.0.1

A library for extending `Path` and `PathBuf` in order to parse the path which contains dots.
Documentation
1
2
3
4
5
6
7
8
9
10
use std::{borrow::Cow, io, path::Path};

/// Let `Path` and `PathBuf` have `parse_dot` method.
pub trait ParseDot {
    /// Remove dots in the path and create a new `PathBuf` instance on demand.
    fn parse_dot(&self) -> io::Result<Cow<'_, Path>>;

    /// Remove dots in the path and create a new `PathBuf` instance on demand. It gets the current working directory as the second argument.
    fn parse_dot_from(&self, cwd: impl AsRef<Path>) -> Cow<'_, Path>;
}