From 232a11ebbaa265da1254f7f4b6485bd6a9b7abc2 Mon Sep 17 00:00:00 2001 From: Hanif Bin Ariffin Date: Mon, 4 May 2020 10:07:05 -0400 Subject: [PATCH] Don't bother looping if its empty. --- src/cargo/core/resolver/errors.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cargo/core/resolver/errors.rs b/src/cargo/core/resolver/errors.rs index 68ed530e539..8ee19f4942f 100644 --- a/src/cargo/core/resolver/errors.rs +++ b/src/cargo/core/resolver/errors.rs @@ -173,11 +173,11 @@ pub(super) fn activation_error( "\n\nall possible versions conflict with \ previously selected packages.", ); - } - for &(p, _) in other_errors.iter() { - msg.push_str("\n\n previously selected "); - msg.push_str(&describe_path(&cx.parents.path_to_bottom(p))); + for &(p, _) in other_errors.iter() { + msg.push_str("\n\n previously selected "); + msg.push_str(&describe_path(&cx.parents.path_to_bottom(p))); + } } msg.push_str("\n\nfailed to select a version for `");