1
Fork 0

remove some uses of try!

This commit is contained in:
Mark Mansi 2018-12-01 15:48:55 -06:00
parent d48ab693d1
commit e7e96921c2
11 changed files with 25 additions and 27 deletions

View file

@ -2065,7 +2065,7 @@ impl DirBuilder {
Err(e) => return Err(e),
}
match path.parent() {
Some(p) => try!(self.create_dir_all(p)),
Some(p) => self.create_dir_all(p)?,
None => return Err(io::Error::new(io::ErrorKind::Other, "failed to create whole tree")),
}
match self.inner.mkdir(path) {

View file

@ -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);