Address review comment, no need to check export_dir.
authorEric Huss <eric@huss.org>
Thu, 10 May 2018 16:34:46 +0000 (09:34 -0700)
committerEric Huss <eric@huss.org>
Thu, 10 May 2018 16:34:46 +0000 (09:34 -0700)
src/cargo/core/compiler/context/compilation_files.rs
src/cargo/core/compiler/mod.rs

index a2e91ef7acdc10be6bdcf53591c92e4cf2a090dd..5359ac751e87e09034ada003965d8cdc56b2b9f0 100644 (file)
@@ -113,12 +113,8 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
         }
     }
 
-    pub fn export_dir(&self, unit: &Unit<'a>) -> Option<PathBuf> {
-        if self.roots.contains(unit) {
-            self.export_dir.clone()
-        } else {
-            None
-        }
+    pub fn export_dir(&self) -> Option<PathBuf> {
+        self.export_dir.clone()
     }
 
     pub fn pkg_dir(&self, unit: &Unit<'a>) -> String {
index 8b503aaae6af33168fb2545b2efffa3cd7fadcd7..d1282ab834c8f7b90c757bb500d61c6c158970a1 100644 (file)
@@ -362,7 +362,7 @@ fn link_targets<'a, 'cfg>(
 ) -> CargoResult<Work> {
     let bcx = cx.bcx;
     let outputs = cx.outputs(unit)?;
-    let export_dir = cx.files().export_dir(unit);
+    let export_dir = cx.files().export_dir();
     let package_id = unit.pkg.package_id().clone();
     let target = unit.target.clone();
     let profile = unit.profile;