From 68cb1388ca5df4c78a91250490d8f95461d3661f Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Thu, 3 Nov 2022 16:49:53 -0700 Subject: [PATCH] Appease new clippy --- src/arc_str.rs | 9 +++------ src/substr.rs | 7 ++++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/arc_str.rs b/src/arc_str.rs index 8c14fc4..ac56cc2 100644 --- a/src/arc_str.rs +++ b/src/arc_str.rs @@ -948,22 +948,19 @@ impl From for alloc::sync::Arc { impl From> for ArcStr { #[inline] fn from(s: alloc::rc::Rc) -> Self { - let s: &str = &*s; - Self::from(s) + Self::from(&*s) } } impl From> for ArcStr { #[inline] fn from(s: alloc::sync::Arc) -> Self { - let s: &str = &*s; - Self::from(s) + Self::from(&*s) } } impl<'a> From> for ArcStr { #[inline] fn from(s: Cow<'a, str>) -> Self { - let s: &str = &*s; - Self::from(s) + Self::from(&*s) } } impl<'a> From<&'a ArcStr> for Cow<'a, str> { diff --git a/src/substr.rs b/src/substr.rs index d7557a7..7d0192c 100644 --- a/src/substr.rs +++ b/src/substr.rs @@ -1,11 +1,12 @@ #![allow( -// We follow libstd's lead and prefer to define both. + // We follow libstd's lead and prefer to define both. clippy::partialeq_ne_impl, -// This is a really annoying clippy lint, since it's required for so many cases... + // This is a really annoying clippy lint, since it's required for so many cases... clippy::cast_ptr_alignment, -// For macros + // For macros clippy::redundant_slicing, )] +#![cfg_attr(feature = "substr-usize-indices", allow(clippy::unnecessary_cast))] use crate::ArcStr; use core::ops::{Range, RangeBounds};