From 059b842d1bace6f50d00337a1500e1eaef862c12 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 9 May 2024 13:33:50 -0500 Subject: [PATCH] is_wsl(): Move .copied() earlier in the iter pipeline This is a best practice that usually helps with auto vectorization, as llvm has a hard time seeing through the references. --- src/common.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common.rs b/src/common.rs index 706b477d3..60d163433 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1719,10 +1719,10 @@ pub fn is_windows_subsystem_for_linux() -> bool { let release: Vec<_> = release .iter() - .skip_while(|c| **c != b'-') + .copied() + .skip_while(|c| *c != b'-') .skip(1) // the dash itself .take_while(|c| c.is_ascii_digit()) - .copied() .collect(); let build: Result = std::str::from_utf8(&release).unwrap().parse(); match build {