#[cfg(test)]
#[path = "./as_path_test.rs"]
mod as_path_test;
use std::path::{Path, PathBuf};
pub trait AsPath {
fn as_path(&self) -> &Path;
}
impl AsPath for str {
fn as_path(&self) -> &Path {
Path::new(self)
}
}
impl AsPath for &str {
fn as_path(&self) -> &Path {
Path::new(self)
}
}
impl AsPath for String {
fn as_path(&self) -> &Path {
Path::new(self)
}
}
impl AsPath for &String {
fn as_path(&self) -> &Path {
Path::new(self)
}
}
impl AsPath for &Path {
fn as_path(&self) -> &Path {
self
}
}
impl AsPath for PathBuf {
fn as_path(&self) -> &Path {
PathBuf::as_path(&self)
}
}