From 43b3fa1e7e304430ece7c359d1bab63558cffd76 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 21 Jun 2024 21:33:15 +0700 Subject: [PATCH] Remove unused `RefWithCost` (#204) This was brought over from `ncollide` and was unused at the time. This code generates warnings in nightly builds due to being dead. --- src/utils/mod.rs | 1 - src/utils/ref_with_cost.rs | 40 -------------------------------------- 2 files changed, 41 deletions(-) delete mode 100644 src/utils/ref_with_cost.rs diff --git a/src/utils/mod.rs b/src/utils/mod.rs index ce43163a..afed2c31 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -55,7 +55,6 @@ mod point_cloud_support_point; mod point_in_poly2d; #[cfg(feature = "dim2")] pub mod point_in_triangle; -mod ref_with_cost; mod sdp_matrix; mod segments_intersection; mod sort; diff --git a/src/utils/ref_with_cost.rs b/src/utils/ref_with_cost.rs deleted file mode 100644 index cf65480d..00000000 --- a/src/utils/ref_with_cost.rs +++ /dev/null @@ -1,40 +0,0 @@ -//! A reference packed with a cost value. - -use std::cmp::Ordering; - -/// A reference packed with a cost value. -pub struct RefWithCost<'a, Real, T: 'a> { - /// The reference to an object. - pub object: &'a T, - /// The cost of the object. - pub cost: Real, -} - -impl<'a, Real: PartialEq, T> PartialEq for RefWithCost<'a, Real, T> { - #[inline] - fn eq(&self, other: &RefWithCost<'a, Real, T>) -> bool { - self.cost.eq(&other.cost) - } -} - -impl<'a, Real: PartialEq, T> Eq for RefWithCost<'a, Real, T> {} - -impl<'a, Real: PartialOrd, T> PartialOrd for RefWithCost<'a, Real, T> { - #[inline] - fn partial_cmp(&self, other: &RefWithCost<'a, Real, T>) -> Option { - Some(self.cmp(other)) - } -} - -impl<'a, Real: PartialOrd, T> Ord for RefWithCost<'a, Real, T> { - #[inline] - fn cmp(&self, other: &RefWithCost<'a, Real, T>) -> Ordering { - if self.cost < other.cost { - Ordering::Less - } else if self.cost > other.cost { - Ordering::Greater - } else { - Ordering::Equal - } - } -}