Skip to content

Commit

Permalink
Fail build on clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
indy256 committed Jan 19, 2025
1 parent 3b3465b commit 1449e91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run: |
cd rust
cargo fmt -- --check
RUSTFLAGS="-A unused" cargo clippy
RUSTFLAGS="-A unused" cargo clippy -- -Dwarnings
cargo clippy --tests
- name: compile and test
run: |
Expand Down
5 changes: 4 additions & 1 deletion rust/structures/treap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<K: Copy + PartialOrd, V: Copy + PartialEq + AddAssign + Ord + Default> Trea
value,
mx: value,
add: V::default(),
prio: rand::thread_rng().gen_range(0..1000_000_000),
prio: rand::thread_rng().gen_range(0..1_000_000_000),
size: 1,
left: None,
right: None,
Expand Down Expand Up @@ -59,6 +59,7 @@ impl<K: Copy + PartialOrd, V: Copy + PartialEq + AddAssign + Ord + Default> Trea
node.as_ref().map_or(value, |t| max(t.mx, value))
}

#[allow(clippy::type_complexity)]
pub fn split(
root: Option<Box<Treap<K, V>>>,
min_right: K,
Expand All @@ -73,6 +74,7 @@ impl<K: Copy + PartialOrd, V: Copy + PartialEq + AddAssign + Ord + Default> Trea
Self::inner_split(root, min_right, |a, b| a > b)
}

#[allow(clippy::type_complexity)]
fn inner_split<F: Fn(K, K) -> bool>(
root: Option<Box<Treap<K, V>>>,
min_right: K,
Expand Down Expand Up @@ -139,6 +141,7 @@ impl<K: Copy + PartialOrd, V: Copy + PartialEq + AddAssign + Ord + Default> Trea
) -> Option<Box<Treap<K, V>>> {
let (l1, r1) = Self::strict_split(root, rr);
let (l2, mut r2) = Self::split(l1, ll);
#[allow(clippy::option_map_unit_fn)]
r2.as_mut().map(|t| t.apply(delta));
Self::merge(Self::merge(l2, r2), r1)
}
Expand Down

0 comments on commit 1449e91

Please sign in to comment.