File tree 5 files changed +6
-6
lines changed
features/functions-and-methods
5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -63,4 +63,4 @@ for more details.
63
63
### The ` Result ` -` impl ` pattern [ FIXME]
64
64
65
65
> ** [ FIXME] ** Document the way that the ` io ` module uses trait impls
66
- > on ` IoResult ` to painlessly propagate errors.
66
+ > on ` std::io::Result ` to painlessly propagate errors.
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ The primary exception: sometimes a function is meant to modify data
121
121
that the caller already owns , for example to re - use a buffer :
122
122
123
123
```rust
124
- fn read (& mut self , buf : & mut [u8 ]) -> IoResult <usize >
124
+ fn read (& mut self , buf : & mut [u8 ]) -> std :: io :: Result <usize >
125
125
```
126
126
127
127
(From the [Reader trait ](http : // static.rust-lang.org/doc/master/std/io/trait.Reader.html#tymethod.read).)
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ impl Command {
75
75
}
76
76
77
77
/// Executes the command as a child process, which is returned.
78
- pub fn spawn (& self ) -> IoResult <Process > {
78
+ pub fn spawn (& self ) -> std :: io :: Result <Process > {
79
79
...
80
80
}
81
81
}
Original file line number Diff line number Diff line change 164
164
//! provides some helper methods.
165
165
//!
166
166
//! Additionally, the return value of this function is `fmt::Result` which is a
167
- //! typedef to `Result<(), IoError >` (also known as `IoResult <()>`). Formatting
168
- //! implementations should ensure that they return errors from `write!`
167
+ //! typedef to `Result<(), std::io::Error >` (also known as `std::io::Result <()>`).
168
+ //! Formatting implementations should ensure that they return errors from `write!`
169
169
//! correctly (propagating errors upward).
170
170
//!
171
171
//! An example of implementing the formatting traits would look
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ impl StdRng {
95
95
/// appropriate.
96
96
///
97
97
/// Reading the randomness from the OS may fail, and any error is
98
- /// propagated via the `IoResult ` return value.
98
+ /// propagated via the `io::Result ` return value.
99
99
pub fn new ( ) -> io:: Result < StdRng > {
100
100
OsRng :: new ( ) . map ( |mut r| StdRng { rng : r. gen ( ) } )
101
101
}
You can’t perform that action at this time.
0 commit comments