From 0909ce382fe2cd08a21cfe7c3bbad8fd7670a1bb Mon Sep 17 00:00:00 2001 From: Ryman Date: Sat, 16 May 2015 00:16:11 +0100 Subject: libstd: Path docs: `file` is now `file_name` --- src/libstd/path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 934b3156357..6732af556e0 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1485,7 +1485,7 @@ impl Path { iter_after(self.components().rev(), child.as_ref().components().rev()).is_some() } - /// Extracts the stem (non-extension) portion of `self.file()`. + /// Extracts the stem (non-extension) portion of `self.file_name()`. /// /// The stem is: /// @@ -1508,7 +1508,7 @@ impl Path { self.file_name().map(split_file_at_dot).and_then(|(before, after)| before.or(after)) } - /// Extracts the extension of `self.file()`, if possible. + /// Extracts the extension of `self.file_name()`, if possible. /// /// The extension is: /// -- cgit 1.4.1-3-g733a5 From e30909de1149d72ce4729481581baa08264c9d8b Mon Sep 17 00:00:00 2001 From: Emilio Cobos Álvarez Date: Sat, 16 May 2015 02:21:05 +0200 Subject: Small typo in the docs Just detected it while reading. --- src/libstd/collections/hash/map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 48f65a5abfd..a5fbc4374e0 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -539,7 +539,7 @@ impl HashMap { /// Creates an empty hashmap which will use the given hasher to hash keys. /// - /// The creates map has the default initial capacity. + /// The created map has the default initial capacity. /// /// # Examples /// -- cgit 1.4.1-3-g733a5 From b6e755df66eb5c54055ceef559ff985ddf78c446 Mon Sep 17 00:00:00 2001 From: Johannes Hoff Date: Sat, 16 May 2015 16:07:52 -0700 Subject: fs::walk_dir example without unstable features The current version of the example won't compile due to unstable features. This is an attempt to fix that, at the cost of slightly more verbose code. --- src/libstd/fs.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index fc5405ea7f6..481d9e69abd 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1099,20 +1099,19 @@ pub fn remove_dir_all>(path: P) -> io::Result<()> { /// # Examples /// /// ``` -/// # #![feature(path_ext)] /// use std::io; -/// use std::fs::{self, PathExt, DirEntry}; +/// use std::fs::{self, DirEntry}; /// use std::path::Path; /// /// // one possible implementation of fs::walk_dir only visiting files -/// fn visit_dirs(dir: &Path, cb: &mut FnMut(DirEntry)) -> io::Result<()> { -/// if dir.is_dir() { +/// fn visit_dirs(dir: &Path, cb: &Fn(&DirEntry)) -> io::Result<()> { +/// if try!(fs::metadata(dir)).is_dir() { /// for entry in try!(fs::read_dir(dir)) { /// let entry = try!(entry); -/// if entry.path().is_dir() { +/// if try!(fs::metadata(entry.path())).is_dir() { /// try!(visit_dirs(&entry.path(), cb)); /// } else { -/// cb(entry); +/// cb(&entry); /// } /// } /// } -- cgit 1.4.1-3-g733a5 From e1f73b8e2bc8696f6ba21d44de7808cad861bb42 Mon Sep 17 00:00:00 2001 From: Ben Striegel Date: Sat, 16 May 2015 22:30:25 -0400 Subject: Simplify CString doc comment No need for `&b"foo"[..]` to make a CString, `"foo"` will do. --- src/libstd/ffi/c_str.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 04513e9d048..b83a8efe1d0 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -53,8 +53,7 @@ use vec::Vec; /// fn my_printer(s: *const libc::c_char); /// } /// -/// let to_print = &b"Hello, world!"[..]; -/// let c_to_print = CString::new(to_print).unwrap(); +/// let c_to_print = CString::new("Hello, world!").unwrap(); /// unsafe { /// my_printer(c_to_print.as_ptr()); /// } -- cgit 1.4.1-3-g733a5 From e5e722bd3244c927fb672850805c3b3f3bd46e79 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 16 May 2015 22:24:13 -0700 Subject: std: Reexport std::net::tcp::Incoming This iterator was mistakenly not reexported at the top level, preventing actually naming the type! Closes #25519 --- src/libstd/net/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index bff9774bcd0..a79a451305d 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -19,7 +19,7 @@ use sys_common::net as net_imp; pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope}; pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs}; -pub use self::tcp::{TcpStream, TcpListener}; +pub use self::tcp::{TcpStream, TcpListener, Incoming}; pub use self::udp::UdpSocket; pub use self::parser::AddrParseError; -- cgit 1.4.1-3-g733a5