From: Eh2406 Date: Wed, 9 May 2018 17:20:25 +0000 (-0400) Subject: use impl Trait X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2^2~42^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2e2945f8e21604f1440f43b5a8bf401b127a1769;p=cargo.git use impl Trait --- diff --git a/src/cargo/core/resolver/types.rs b/src/cargo/core/resolver/types.rs index 543c72e7e..1190121da 100644 --- a/src/cargo/core/resolver/types.rs +++ b/src/cargo/core/resolver/types.rs @@ -206,13 +206,10 @@ impl DepsFrame { .unwrap_or(0) } - pub fn flatten<'s>(&'s self) -> Box + 's> { - // TODO: with impl Trait the Box can be removed - Box::new( - self.remaining_siblings - .clone() - .map(move |(_, (d, _, _))| (self.parent.package_id(), d)), - ) + pub fn flatten<'s>(&'s self) -> impl Iterator + 's { + self.remaining_siblings + .clone() + .map(move |(_, (d, _, _))| (self.parent.package_id(), d)) } }