Return errors instead of ignoring them
authorRob Tsuk <robtsuk@google.com>
Tue, 13 Mar 2018 23:03:30 +0000 (16:03 -0700)
committerRob Tsuk <robtsuk@google.com>
Tue, 13 Mar 2018 23:03:30 +0000 (16:03 -0700)
src/cargo/ops/cargo_rustc/output_depinfo.rs

index ef1a90242480cebc9336a5d683f6bf8f8e02e6e3..13f82f2b194dbc75e42b210bdd2f6a5e9a8e8d77 100644 (file)
@@ -71,17 +71,12 @@ pub fn output_depinfo<'a, 'b>(context: &mut Context<'a, 'b>, unit: &Unit<'a>) ->
     let mut visited = HashSet::new();
     let success = add_deps_for_unit(&mut deps, context, unit, &mut visited).is_ok();
     let basedir_string;
-    let basedir = match context.config.get_string("dep-info-basedir") {
-        Ok(config) => {
-            match config {
-                Some(value) => {
-                    basedir_string = value.val;
-                    Some(basedir_string.as_str())
-                }
-                None => None,
-            }
-        },
-        _ => None
+    let basedir = match context.config.get_string("dep-info-basedir")? {
+        Some(value) => {
+            basedir_string = value.val;
+            Some(basedir_string.as_str())
+        }
+        None => None,
     };
     for &(_, ref link_dst, _) in context.target_filenames(unit)?.iter() {
         if let Some(ref link_dst) = *link_dst {