Skip to content

Commit

Permalink
Fix clippy hints
Browse files Browse the repository at this point in the history
  • Loading branch information
BinderDavid committed May 12, 2024
1 parent 6084454 commit 40302d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ impl LineIndex {
}
}

#[allow(clippy::derivable_impls)]
impl Default for LineIndex {
fn default() -> LineIndex {
LineIndex(0)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -125,6 +127,7 @@ impl ColumnIndex {
}
}

#[allow(clippy::derivable_impls)]
impl Default for ColumnIndex {
fn default() -> ColumnIndex {
ColumnIndex(0)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -198,6 +202,7 @@ impl ByteIndex {
}
}

#[allow(clippy::derivable_impls)]
impl Default for ByteIndex {
fn default() -> ByteIndex {
ByteIndex(0)
Expand Down
2 changes: 1 addition & 1 deletion src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 40302d2

Please sign in to comment.