about summary refs log tree commit diff
path: root/src/libstd/sys/windows
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2015-03-26 13:39:23 -0700
committerAaron Turon <aturon@mozilla.com>2015-03-26 13:54:48 -0700
commite7525cf6200e5b62a4b1a2f3131f68d946fb331e (patch)
tree165561491041bb90c0b19df6c22d72f615da1251 /src/libstd/sys/windows
parent557d4346a26266d2eb13f6b0adf106b8873b0da1 (diff)
downloadrust-e7525cf6200e5b62a4b1a2f3131f68d946fb331e.tar.gz
rust-e7525cf6200e5b62a4b1a2f3131f68d946fb331e.zip
Revise use of conversion traits
This commit revises `path` and `os_str` to use blanket impls for `From`
on reference types. This both cuts down on the number of required impls,
and means that you can pass through e.g. `T: AsRef<OsStr>` to
`PathBuf::from` without an intermediate call to `as_ref`.

It also makes a FIXME note for later generalizing the blanket impls for
`AsRef` and `AsMut` to use `Deref`/`DerefMut`, once it is possible to do
so.
Diffstat (limited to 'src/libstd/sys/windows')
-rw-r--r--src/libstd/sys/windows/os_str.rs4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/libstd/sys/windows/os_str.rs b/src/libstd/sys/windows/os_str.rs
index ad1e6c4b0e7..91905ae7489 100644
--- a/src/libstd/sys/windows/os_str.rs
+++ b/src/libstd/sys/windows/os_str.rs
@@ -45,10 +45,6 @@ impl Buf {
         Buf { inner: Wtf8Buf::from_string(s) }
     }
 
-    pub fn from_str(s: &str) -> Buf {
-        Buf { inner: Wtf8Buf::from_str(s) }
-    }
-
     pub fn as_slice(&self) -> &Slice {
         unsafe { mem::transmute(self.inner.as_slice()) }
     }