Skip to content

Commit

Permalink
build: enforce clippy
Browse files Browse the repository at this point in the history
Co-authored-by: warren2k <[email protected]>
  • Loading branch information
mightyiam and warren2k committed Aug 27, 2023
1 parent 6683438 commit 86ac53b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- run: cargo check ${{ matrix.features }}
- run: cargo clippy ${{ matrix.features }}

test:
name: test
Expand Down
38 changes: 38 additions & 0 deletions wrappers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//! This module helps suppress two kinds of warnings: `deprecated` and `unstable_name_collisions`.
//! New items are created that are noop-wrappers of the original items.
//! The items' original paths are preserved.
use itertools::Itertools;

pub mod free {
// it seems the compiler is not able to discern that this is used
#[allow(dead_code)]
pub fn zip<I, J>(i: I, j: J) -> core::iter::Zip<I::IntoIter, J::IntoIter>
where I: IntoIterator,
J: IntoIterator
{
#[allow(deprecated)]
itertools::free::zip(i, j)
}
}

pub trait Ext: Itertools {
fn intersperse_wrap(self, element: Self::Item) -> itertools::Intersperse<Self>
where
Self: Sized,
Self::Item: Clone,
{
<Self as Itertools>::intersperse(self, element)
}

fn fold1_wrap<F>(self, f: F) -> Option<Self::Item>
where F: FnMut(Self::Item, Self::Item) -> Self::Item,
Self: Sized,
{
#[allow(deprecated)]
<Self as Itertools>::fold1(self, f)
}
}

impl<T: Itertools> Ext for T {}

0 comments on commit 86ac53b

Please sign in to comment.