diff --git a/src/chmod/chmod.rs b/src/chmod/chmod.rs index de8ae0c7d..6a9d0ce7b 100644 --- a/src/chmod/chmod.rs +++ b/src/chmod/chmod.rs @@ -205,9 +205,9 @@ fn chmod_file(file: &Path, name: &str, changes: bool, quiet: bool, verbose: bool }; for mode in cmode.unwrap().as_slice().split(',') { // cmode is guaranteed to be Some in this case let cap = REGEXP.captures(mode).unwrap(); // mode was verified earlier, so this is safe - if cap.at(1) != "" { + if cap.at(1).unwrap() != "" { // symbolic - let mut levels = cap.at(2); + let mut levels = cap.at(2).unwrap(); if levels.len() == 0 { levels = "a"; } @@ -272,7 +272,7 @@ fn chmod_file(file: &Path, name: &str, changes: bool, quiet: bool, verbose: bool } } else { // numeric - let change = cap.at(4); + let change = cap.at(4).unwrap(); let ch = change.char_at(0); let (action, slice) = match ch { '+' | '-' | '=' => (ch, change.slice_from(1)), diff --git a/src/hashsum/hashsum.rs b/src/hashsum/hashsum.rs index f0a6b739e..d9d022b5a 100644 --- a/src/hashsum/hashsum.rs +++ b/src/hashsum/hashsum.rs @@ -213,9 +213,13 @@ fn hashsum(algoname: &str, mut digest: Box, files: Vec, binary: for (i, line) in buffer.lines().enumerate() { let line = safe_unwrap!(line); let (ck_filename, sum, binary_check): (_, Vec, _) = match gnu_re.captures(line.as_slice()) { - Some(caps) => (caps.name("fileName"), caps.name("digest").to_ascii().iter().map(|ch| ch.to_lowercase()).collect(), caps.name("binary") == "*"), + Some(caps) => (caps.name("fileName").unwrap(), + caps.name("digest").unwrap().to_ascii().iter().map(|ch| ch.to_lowercase()).collect(), + caps.name("binary").unwrap() == "*"), None => match bsd_re.captures(line.as_slice()) { - Some(caps) => (caps.name("fileName"), caps.name("digest").to_ascii().iter().map(|ch| ch.to_lowercase()).collect(), true), + Some(caps) => (caps.name("fileName").unwrap(), + caps.name("digest").unwrap().to_ascii().iter().map(|ch| ch.to_lowercase()).collect(), + true), None => { bad_format += 1; if strict {