Skip to content

Commit 86ac53b

Browse files
mightyiamwarren2k
andcommitted
build: enforce clippy
Co-authored-by: warren2k <[email protected]>
1 parent 6683438 commit 86ac53b

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- uses: dtolnay/rust-toolchain@master
3636
with:
3737
toolchain: ${{ matrix.rust }}
38-
- run: cargo check ${{ matrix.features }}
38+
- run: cargo clippy ${{ matrix.features }}
3939

4040
test:
4141
name: test

wrappers.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//! This module helps suppress two kinds of warnings: `deprecated` and `unstable_name_collisions`.
2+
//! New items are created that are noop-wrappers of the original items.
3+
//! The items' original paths are preserved.
4+
5+
use itertools::Itertools;
6+
7+
pub mod free {
8+
// it seems the compiler is not able to discern that this is used
9+
#[allow(dead_code)]
10+
pub fn zip<I, J>(i: I, j: J) -> core::iter::Zip<I::IntoIter, J::IntoIter>
11+
where I: IntoIterator,
12+
J: IntoIterator
13+
{
14+
#[allow(deprecated)]
15+
itertools::free::zip(i, j)
16+
}
17+
}
18+
19+
pub trait Ext: Itertools {
20+
fn intersperse_wrap(self, element: Self::Item) -> itertools::Intersperse<Self>
21+
where
22+
Self: Sized,
23+
Self::Item: Clone,
24+
{
25+
<Self as Itertools>::intersperse(self, element)
26+
}
27+
28+
fn fold1_wrap<F>(self, f: F) -> Option<Self::Item>
29+
where F: FnMut(Self::Item, Self::Item) -> Self::Item,
30+
Self: Sized,
31+
{
32+
#[allow(deprecated)]
33+
<Self as Itertools>::fold1(self, f)
34+
}
35+
}
36+
37+
impl<T: Itertools> Ext for T {}
38+

0 commit comments

Comments
 (0)