diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92122cca0..8d4411d52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/wrappers.rs b/wrappers.rs new file mode 100644 index 000000000..b94a5f215 --- /dev/null +++ b/wrappers.rs @@ -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: I, j: J) -> core::iter::Zip + 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 + where + Self: Sized, + Self::Item: Clone, + { + ::intersperse(self, element) + } + + fn fold1_wrap(self, f: F) -> Option + where F: FnMut(Self::Item, Self::Item) -> Self::Item, + Self: Sized, + { + #[allow(deprecated)] + ::fold1(self, f) + } +} + +impl Ext for T {} +