Skip to content

Commit

Permalink
Clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
urschrei committed Sep 6, 2024
1 parent 534415e commit aa00430
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod ffi;
pub use crate::ffi::{polylabel_ffi, Array, Position, WrapperArray};

/// Represention of a Quadtree node's cells. A node contains four Qcells.
#[derive(Debug)]
#[derive(Debug, Clone)]
struct Qcell<T>
where
T: GeoFloat,
Expand All @@ -44,11 +44,11 @@ impl<T> Qcell<T>
where
T: GeoFloat,
{
fn new(centroid: Point<T>, half_extent: T, polygon: &Polygon<T>) -> Qcell<T> {
fn new(centroid: Point<T>, half_extent: T, polygon: &Polygon<T>) -> Self {
let two = T::one() + T::one();
let distance = signed_distance(centroid, polygon);
let max_distance = distance + half_extent * two.sqrt();
Qcell {
Self {
centroid,
half_extent,
distance,
Expand All @@ -61,15 +61,15 @@ impl<T> Ord for Qcell<T>
where
T: GeoFloat,
{
fn cmp(&self, other: &Qcell<T>) -> std::cmp::Ordering {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.max_distance.partial_cmp(&other.max_distance).unwrap()
}
}
impl<T> PartialOrd for Qcell<T>
where
T: GeoFloat,
{
fn partial_cmp(&self, other: &Qcell<T>) -> Option<Ordering> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
Expand All @@ -78,7 +78,7 @@ impl<T> PartialEq for Qcell<T>
where
T: GeoFloat,
{
fn eq(&self, other: &Qcell<T>) -> bool
fn eq(&self, other: &Self) -> bool
where
T: GeoFloat,
{
Expand Down

0 comments on commit aa00430

Please sign in to comment.