From: Matt Brubeck Date: Mon, 5 Feb 2018 18:31:22 +0000 (-0800) Subject: Clean up lib_or_check_profile code X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~3^2~14^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9bb9dbd3c331486a7663602097141356c82c13f4;p=cargo.git Clean up lib_or_check_profile code --- diff --git a/src/cargo/ops/cargo_rustc/context.rs b/src/cargo/ops/cargo_rustc/context.rs index da22f57ed..325d74346 100644 --- a/src/cargo/ops/cargo_rustc/context.rs +++ b/src/cargo/ops/cargo_rustc/context.rs @@ -1055,14 +1055,12 @@ impl<'a, 'cfg> Context<'a, 'cfg> { } pub fn lib_or_check_profile(&self, unit: &Unit, target: &Target) -> &'a Profile { - if unit.profile.check && !target.is_custom_build() && !target.for_host() { - &self.profiles.check - } else if unit.profile.doc && !unit.profile.test && - !target.is_custom_build() && !target.for_host() { - &self.profiles.check - } else { - self.lib_profile() + if !target.is_custom_build() && !target.for_host() { + if unit.profile.check || (unit.profile.doc && !unit.profile.test) { + return &self.profiles.check + } } + self.lib_profile() } pub fn build_script_profile(&self, _pkg: &PackageId) -> &'a Profile {