From 7df5acc2dccdaa8d7bdc5396c3f3f6f21632cabb Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 6 Jun 2021 17:43:44 -0500 Subject: [PATCH] tests ~ fix `cargo clippy` complaint (*allow* clippy::manual_strip; with FixME/ToDO) - replace with the included/noted code when MSRV includes a stabilized `String::strip_prefix()` --- tests/common/util.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/common/util.rs b/tests/common/util.rs index 2f7d7dcc4..11425e9b8 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -625,11 +625,20 @@ impl AtPath { // Source: // http://stackoverflow.com/questions/31439011/getfinalpathnamebyhandle-without-prepended let prefix = "\\\\?\\"; + // FixME: replace ... + #[allow(clippy::manual_strip)] if s.starts_with(prefix) { String::from(&s[prefix.len()..]) } else { s } + // ... with ... + // if let Some(stripped) = s.strip_prefix(prefix) { + // String::from(stripped) + // } else { + // s + // } + // ... when using MSRV with stabilized `strip_prefix()` } }