Manually ignore warnings

This commit is contained in:
hal8174 2025-04-26 23:09:54 +02:00
parent 0ced2c3c44
commit f639082205
10 changed files with 26 additions and 27 deletions

View file

@ -11,13 +11,13 @@ pub struct BucketQueue<Item> {
impl<Item> std::fmt::Debug for BucketQueue<Item> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
struct DebugWrapper2<'a, I>(&'a Vec<(usize, I)>);
impl<'a, I> std::fmt::Debug for DebugWrapper2<'a, I> {
impl<I> std::fmt::Debug for DebugWrapper2<'_, I> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_list().entries(self.0.iter().map(|v| v.0)).finish()
}
}
struct DebugWrapper<'a, I>(&'a VecDeque<Vec<(usize, I)>>);
impl<'a, I> std::fmt::Debug for DebugWrapper<'a, I> {
impl<I> std::fmt::Debug for DebugWrapper<'_, I> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_list()
.entries(self.0.iter().map(|v| DebugWrapper2(v)))

View file

@ -28,7 +28,7 @@ pub fn greedy_set_cover_simple<S>(universe: usize, sets: &[S]) -> Vec<usize>
where
S: Deref<Target = [usize]>,
{
assert!(sets.len() > 0);
assert!(!sets.is_empty());
let mut r = Vec::new();

View file

@ -15,9 +15,9 @@ impl<N> QueueObject<N> {
}
}
impl<N> Into<i64> for &QueueObject<N> {
fn into(self) -> i64 {
self.score
impl<N> From<&QueueObject<N>> for i64 {
fn from(val: &QueueObject<N>) -> Self {
val.score
}
}