paved 0.6.0

A simple platform agnostic path representation
Documentation
use std::path::{Display, Path, PathBuf};

use crate::{PavedPath, PlatformStyle};

impl PavedPath {
    /// Returns a reference to a [`Path`] representation of the [`PavedPath`]
    pub fn as_path(&self) -> &Path {
        &self.inner
    }

    /// Returns a reference to a [`PathBuf`] representation of the [`PavedPath`]
    pub fn as_pathbuf(&self) -> &PathBuf {
        &self.inner
    }

    /// Returns the inner [`PathBuf`], consuming self
    pub fn to_pathbuf(self) -> PathBuf {
        self.inner
    }

    /// Build the path in the specified [`PlatformStyle`]
    ///
    /// If you want to use it for the platform the binary is running on, [`PavedPath`] also implements [`AsRef<PathBuf>`] allowing you to simply use it as a normal [PathBuf], this [PathBuf] contains the representation native to your platform
    pub fn path_in_style(&self, style: PlatformStyle) -> PathBuf {
        match style {
            PlatformStyle::Unix => self.build_unix_pathbuf(),
            PlatformStyle::Windows => self.build_windows_pathbuf(),
        }
    }

    /// Identical to [`std::path::Path::display()`]
    ///
    /// See [`std::path::Path::display()`] for more
    pub fn display(&self) -> Display<'_> {
        self.inner.display()
    }
}