Change Into<Vec<u8>> for String and Into<OsString> for PathBuf to From impls
This commit is contained in:
@@ -1904,10 +1904,10 @@ impl<'a> FromIterator<String> for Cow<'a, str> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "from_string_for_vec_u8", since = "1.14.0")]
|
||||||
impl Into<Vec<u8>> for String {
|
impl From<String> for Vec<u8> {
|
||||||
fn into(self) -> Vec<u8> {
|
fn from(string : String) -> Vec<u8> {
|
||||||
self.into_bytes()
|
string.into_bytes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1172,6 +1172,13 @@ impl From<OsString> for PathBuf {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[stable(feature = "from_path_buf_for_os_string", since = "1.14.0")]
|
||||||
|
impl From<PathBuf> for OsString {
|
||||||
|
fn from(path_buf : PathBuf) -> OsString {
|
||||||
|
path_buf.inner
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl From<String> for PathBuf {
|
impl From<String> for PathBuf {
|
||||||
fn from(s: String) -> PathBuf {
|
fn from(s: String) -> PathBuf {
|
||||||
@@ -1282,13 +1289,6 @@ impl AsRef<OsStr> for PathBuf {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
|
||||||
impl Into<OsString> for PathBuf {
|
|
||||||
fn into(self) -> OsString {
|
|
||||||
self.inner
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A slice of a path (akin to [`str`]).
|
/// A slice of a path (akin to [`str`]).
|
||||||
///
|
///
|
||||||
/// This type supports a number of operations for inspecting a path, including
|
/// This type supports a number of operations for inspecting a path, including
|
||||||
|
|||||||
Reference in New Issue
Block a user