From a138d746885aee502352e6d7c9fc48852d8fc435 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sat, 13 Jan 2024 13:03:58 -0600 Subject: [PATCH] Fix unused code warning on cannot-be-WSL platforms No need to use cfg_attr and have to worry about syncing the preconditions for the cfg_attr with the preconditions for where `slice_contains_slice()` is used in the codebase, just mark it as `allow(unused)` with a comment. --- src/common.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common.rs b/src/common.rs index c93a61831..e24e4a241 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1629,6 +1629,8 @@ pub fn restore_term_foreground_process_group_for_exit() { } } +#[allow(unused)] +// This function is unused in some configurations/on some platforms fn slice_contains_slice(a: &[T], b: &[T]) -> bool { a.windows(b.len()).any(|aw| aw == b) }