|
|
@ -1,6 +1,7 @@
|
|
|
|
use std::ffi::{OsStr, OsString};
|
|
|
|
use std::ffi::{OsStr, OsString};
|
|
|
|
#[cfg(feature = "unstable")]
|
|
|
|
#[cfg(feature = "unstable")]
|
|
|
|
use std::pin::Pin;
|
|
|
|
use std::pin::Pin;
|
|
|
|
|
|
|
|
use std::str::FromStr;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::path::Path;
|
|
|
|
use crate::path::Path;
|
|
|
|
#[cfg(feature = "unstable")]
|
|
|
|
#[cfg(feature = "unstable")]
|
|
|
@ -228,6 +229,14 @@ impl From<&str> for PathBuf {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl FromStr for PathBuf {
|
|
|
|
|
|
|
|
type Err = core::convert::Infallible;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
|
|
|
|
|
|
Ok(std::path::PathBuf::from(s).into())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl AsRef<Path> for PathBuf {
|
|
|
|
impl AsRef<Path> for PathBuf {
|
|
|
|
fn as_ref(&self) -> &Path {
|
|
|
|
fn as_ref(&self) -> &Path {
|
|
|
|
Path::new(&self.inner)
|
|
|
|
Path::new(&self.inner)
|
|
|
|