diff --git a/Cargo.toml b/Cargo.toml index 1ef39370..0d3d59fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -790,6 +790,7 @@ rest_pat_in_fully_bound_structs = "warn" semicolon_outside_block = "warn" str_to_string = "warn" string_lit_chars_any = "warn" +string_slice = "warn" string_to_string = "warn" suspicious_xor_used_as_pow = "warn" tests_outside_test_module = "warn" diff --git a/src/core/config/proxy.rs b/src/core/config/proxy.rs index d823e5e4..48f883c6 100644 --- a/src/core/config/proxy.rs +++ b/src/core/config/proxy.rs @@ -127,6 +127,7 @@ impl WildCardedDomain { impl std::str::FromStr for WildCardedDomain { type Err = std::convert::Infallible; + #[allow(clippy::string_slice)] fn from_str(s: &str) -> Result { // maybe do some domain validation? Ok(if s.starts_with("*.") { diff --git a/src/core/utils/html.rs b/src/core/utils/html.rs index 938e50ec..fe07b2dd 100644 --- a/src/core/utils/html.rs +++ b/src/core/utils/html.rs @@ -6,6 +6,7 @@ pub struct Escape<'a>(pub &'a str); /// Copied from librustdoc: /// * +#[allow(clippy::string_slice)] impl fmt::Display for Escape<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { // Because the internet is always right, turns out there's not that many diff --git a/src/core/utils/string.rs b/src/core/utils/string.rs index 1f2a6572..ec423d53 100644 --- a/src/core/utils/string.rs +++ b/src/core/utils/string.rs @@ -9,12 +9,13 @@ pub const EMPTY: &str = ""; /// common_prefix(&input) == "con"; /// ``` #[must_use] +#[allow(clippy::string_slice)] pub fn common_prefix<'a>(choice: &'a [&str]) -> &'a str { choice.first().map_or(EMPTY, move |best| { choice.iter().skip(1).fold(*best, |best, choice| { &best[0..choice - .chars() - .zip(best.chars()) + .char_indices() + .zip(best.char_indices()) .take_while(|&(a, b)| a == b) .count()] }) diff --git a/src/service/sending/resolve.rs b/src/service/sending/resolve.rs index 77311006..d38509ba 100644 --- a/src/service/sending/resolve.rs +++ b/src/service/sending/resolve.rs @@ -484,6 +484,7 @@ impl FedDest { } #[inline] + #[allow(clippy::string_slice)] fn port(&self) -> Option { match &self { Self::Literal(addr) => Some(addr.port()),