From 40302d201483e08d393267f8e99864d146f868cd Mon Sep 17 00:00:00 2001 From: David Binder Date: Sun, 12 May 2024 20:20:17 +0200 Subject: [PATCH] Fix clippy hints --- src/index.rs | 5 +++++ src/span.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.rs b/src/index.rs index 6c6c3b21..473c33d4 100644 --- a/src/index.rs +++ b/src/index.rs @@ -33,6 +33,7 @@ impl LineIndex { } } +#[allow(clippy::derivable_impls)] impl Default for LineIndex { fn default() -> LineIndex { LineIndex(0) @@ -82,6 +83,7 @@ impl fmt::Display for LineNumber { #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct LineOffset(pub RawOffset); +#[allow(clippy::derivable_impls)] impl Default for LineOffset { fn default() -> LineOffset { LineOffset(0) @@ -125,6 +127,7 @@ impl ColumnIndex { } } +#[allow(clippy::derivable_impls)] impl Default for ColumnIndex { fn default() -> ColumnIndex { ColumnIndex(0) @@ -167,6 +170,7 @@ impl fmt::Display for ColumnNumber { #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct ColumnOffset(pub RawOffset); +#[allow(clippy::derivable_impls)] impl Default for ColumnOffset { fn default() -> ColumnOffset { ColumnOffset(0) @@ -198,6 +202,7 @@ impl ByteIndex { } } +#[allow(clippy::derivable_impls)] impl Default for ByteIndex { fn default() -> ByteIndex { ByteIndex(0) diff --git a/src/span.rs b/src/span.rs index e323687c..91db4bde 100644 --- a/src/span.rs +++ b/src/span.rs @@ -37,7 +37,7 @@ impl Span { /// /// assert_eq!(span, Span::new(0, 5)); /// ``` - pub fn from_str(s: &str) -> Span { + pub fn from_string(s: &str) -> Span { Span::new(0, s.len() as u32) }