Skip to content

Commit

Permalink
lints: Enable warn(unused_qualifications)
Browse files Browse the repository at this point in the history
This helps point out where the code can be more concise with
an identifier already being in scope and not needing qualifications.
  • Loading branch information
waywardmonkeys committed May 20, 2024
1 parent 8ff056e commit 8aae265
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/gradient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use super::{Color, Extend};
use kurbo::Point;
use smallvec::SmallVec;

use core::{
cmp,
hash::{Hash, Hasher},
};
use core::hash::{Hash, Hasher};

/// Offset and color of a transition point in a [gradient](Gradient).
#[derive(Copy, Clone, PartialOrd, Default, Debug)]
Expand All @@ -29,13 +26,13 @@ impl Hash for ColorStop {
}

// Override PartialEq to use to_bits for the offset to match with the Hash impl
impl cmp::PartialEq for ColorStop {
impl PartialEq for ColorStop {
fn eq(&self, other: &Self) -> bool {
self.offset.to_bits() == other.offset.to_bits() && self.color == other.color
}
}

impl cmp::Eq for ColorStop {}
impl Eq for ColorStop {}

impl ColorStop {
/// Returns the color stop with the alpha component multiplied by the specified
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! [`kurbo`]: https://crates.io/crates/kurbo

#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
#![warn(clippy::doc_markdown)]
#![warn(clippy::doc_markdown, unused_qualifications)]

mod blend;
mod blob;
Expand Down

0 comments on commit 8aae265

Please sign in to comment.