Rollup merge of #56419 - mark-i-m:remove-try, r=Centril
Remove some uses of try!
This commit is contained in:
commit
ca98bce303
11 changed files with 25 additions and 27 deletions
|
|
@ -48,7 +48,7 @@ pub fn get(handle: c::DWORD) -> io::Result<Output> {
|
|||
}
|
||||
|
||||
fn write(handle: c::DWORD, data: &[u8]) -> io::Result<usize> {
|
||||
let handle = match try!(get(handle)) {
|
||||
let handle = match get(handle)? {
|
||||
Output::Console(c) => c,
|
||||
Output::Pipe(p) => {
|
||||
let handle = Handle::new(p);
|
||||
|
|
@ -99,7 +99,7 @@ impl Stdin {
|
|||
}
|
||||
|
||||
pub fn read(&self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let handle = match try!(get(c::STD_INPUT_HANDLE)) {
|
||||
let handle = match get(c::STD_INPUT_HANDLE)? {
|
||||
Output::Console(c) => c,
|
||||
Output::Pipe(p) => {
|
||||
let handle = Handle::new(p);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue