From decc3b0eba163a45accc4e1157301f528dfc7e50 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 1 Sep 2018 16:46:40 -0700 Subject: [PATCH] tidy: extdeps.rs: Avoid an unnecessary collect() --- src/tools/tidy/src/extdeps.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs index bb375c17682..831eb47858a 100644 --- a/src/tools/tidy/src/extdeps.rs +++ b/src/tools/tidy/src/extdeps.rs @@ -37,8 +37,7 @@ pub fn check(path: &Path, bad: &mut bool) { } // extract source value - let parts: Vec<&str> = line.splitn(2, '=').collect(); - let source = parts[1].trim(); + let source = line.splitn(2, '=').nth(1).unwrap().trim(); // ensure source is whitelisted if !WHITELISTED_SOURCES.contains(&&*source) {