mod private
{
#[ allow( unused_imports ) ]
use crate::*;
#[ cfg( feature = "no_std" ) ]
extern crate std;
use std::path::Path;
pub trait AsPath
{
fn as_path( &self ) -> &Path;
}
impl AsPath for str
{
fn as_path( &self ) -> &Path
{
Path::new( self )
}
}
impl AsPath for Path
{
fn as_path( &self ) -> &Path
{
self
}
}
#[cfg( feature = "path_utf8" )]
impl AsPath for Utf8Path
{
fn as_path( &self ) -> &Path
{
self.as_std_path()
}
}
impl< T > AsPath for T
where
T : AsRef< Path >,
{
fn as_path( &self ) -> &Path
{
self.as_ref()
}
}
}
crate::mod_interface!
{
orphan use AsPath;
}