Skip to content

Commit 1b3d6dc

Browse files
committed
---
yaml --- r: 235496 b: refs/heads/stable c: 4fb02a3 h: refs/heads/master v: v3
1 parent 8867780 commit 1b3d6dc

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 664449ac6e4b607722af4c3defe56af1a40c0a77
32+
refs/heads/stable: 4fb02a391d7e1ef3e94d00f10af18304e5c1b53f
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/libstd/io/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,23 @@ fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize>
149149
///
150150
/// ```
151151
/// use std::io;
152+
/// use std::io::prelude::*;
152153
/// use std::fs::File;
153-
/// use std::io::Read;
154154
///
155155
/// # fn foo() -> io::Result<()> {
156156
/// let mut f = try!(File::open("foo.txt"));
157-
/// let mut buffer = Vec::new();
157+
/// let mut buffer = [0; 10];
158158
///
159-
/// // read some bytes
160-
/// f.read(&mut buffer).unwrap();
159+
/// // read up to 10 bytes
160+
/// try!(f.read(&mut buffer));
161161
///
162+
/// let mut buffer = vec![0; 10];
162163
/// // read the whole file
163-
/// f.read_to_end(&mut buffer).unwrap();
164+
/// try!(f.read_to_end(&mut buffer));
164165
///
165166
/// // read into a String, so that you don't need to do the conversion.
166167
/// let mut buffer = String::new();
167-
/// f.read_to_string(&mut buffer).unwrap();
168+
/// try!(f.read_to_string(&mut buffer));
168169
///
169170
/// // and more! See the other methods for more details.
170171
/// # Ok(())
@@ -910,7 +911,7 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>)
910911
///
911912
/// ```
912913
/// use std::io;
913-
/// use std::io::BufRead;
914+
/// use std::io::prelude::*;
914915
///
915916
/// let stdin = io::stdin();
916917
/// for line in stdin.lock().lines() {
@@ -928,10 +929,9 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>)
928929
/// [file]: ../fs/struct.File.html
929930
///
930931
/// ```
931-
/// use std::io;
932+
/// use std::io::{self, BufReader};
933+
/// use std::io::prelude::*;
932934
/// use std::fs::File;
933-
/// use std::io::BufRead;
934-
/// use std::io::BufReader;
935935
///
936936
/// # fn foo() -> io::Result<()> {
937937
/// let f = try!(File::open("foo.txt"));

0 commit comments

Comments
 (0)