From 5207140bbe55f94cb27bc38972dc109db58ed6d5 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 31 Jul 2017 15:59:14 -0400 Subject: [PATCH] use Work::noop() more Using Work::noop() in these places is clearer. --- src/cargo/ops/cargo_rustc/custom_build.rs | 2 +- src/cargo/ops/cargo_rustc/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cargo/ops/cargo_rustc/custom_build.rs b/src/cargo/ops/cargo_rustc/custom_build.rs index c53fc612e62..727f0d324bf 100644 --- a/src/cargo/ops/cargo_rustc/custom_build.rs +++ b/src/cargo/ops/cargo_rustc/custom_build.rs @@ -79,7 +79,7 @@ pub fn prepare<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) unit.pkg, unit.target.name())); let overridden = cx.build_state.has_override(unit); let (work_dirty, work_fresh) = if overridden { - (Work::new(|_| Ok(())), Work::new(|_| Ok(()))) + (Work::noop(), Work::noop()) } else { build_work(cx, unit)? }; diff --git a/src/cargo/ops/cargo_rustc/mod.rs b/src/cargo/ops/cargo_rustc/mod.rs index 34601913ac7..873bed3e785 100644 --- a/src/cargo/ops/cargo_rustc/mod.rs +++ b/src/cargo/ops/cargo_rustc/mod.rs @@ -234,7 +234,7 @@ fn compile<'a, 'cfg: 'a>(cx: &mut Context<'a, 'cfg>, custom_build::prepare(cx, unit)? } else if unit.profile.doc && unit.profile.test { // we run these targets later, so this is just a noop for now - (Work::new(|_| Ok(())), Work::new(|_| Ok(())), Freshness::Fresh) + (Work::noop(), Work::noop(), Freshness::Fresh) } else { let (mut freshness, dirty, fresh) = fingerprint::prepare_target(cx, unit)?; let work = if unit.profile.doc {