Skip to content

Commit 575819a

Browse files
committed
Merge branch 'master' into Implement-custom-fold-for-zip-longest
2 parents 7bb6845 + c4358ab commit 575819a

File tree

11 files changed

+28
-19
lines changed

11 files changed

+28
-19
lines changed

.github/workflows/ci.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ name: CI
22

33
on:
44
pull_request:
5-
push:
6-
branches:
7-
- staging
8-
- trying
5+
merge_group:
96

107
jobs:
118
check:
@@ -22,7 +19,7 @@ jobs:
2219
steps:
2320
- uses: actions/checkout@v4
2421
- uses: dtolnay/rust-toolchain@stable
25-
- run: cargo check ${{ matrix.features }}
22+
- run: RUSTFLAGS="--deny warnings" cargo check ${{ matrix.features }}
2623

2724
msrv:
2825
runs-on: ubuntu-latest
@@ -52,12 +49,12 @@ jobs:
5249
components: rustfmt
5350
- run: cargo fmt --check
5451

55-
# https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
56-
end-success:
57-
name: bors build finished
52+
# Used to signal to branch protections that all other jobs have succeeded.
53+
all-jobs-succeed:
54+
name: All checks succeeded
5855
if: success()
5956
runs-on: ubuntu-latest
60-
needs: [check, test]
57+
needs: [check, msrv, test, check-format]
6158
steps:
6259
- name: Mark the job as successful
6360
run: exit 0

benches/fold_specialization.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unstable_name_collisions)]
2+
13
use criterion::{criterion_group, criterion_main, Criterion};
24
use itertools::Itertools;
35

benches/tree_fold1.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(deprecated)]
2+
13
use criterion::{criterion_group, criterion_main, Criterion};
24
use itertools::{cloned, Itertools};
35

src/extrema_set.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(feature = "use_alloc")]
2+
use alloc::{vec, vec::Vec};
13
use std::cmp::Ordering;
24

35
/// Implementation guts for `min_set`, `min_set_by`, and `min_set_by_key`.

src/lib.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ use std::hash::Hash;
7070
use std::iter::{once, IntoIterator};
7171
#[cfg(feature = "use_alloc")]
7272
type VecIntoIter<T> = alloc::vec::IntoIter<T>;
73-
#[cfg(feature = "use_alloc")]
7473
use std::iter::FromIterator;
7574

7675
#[macro_use]
@@ -178,7 +177,7 @@ mod diff;
178177
#[cfg(feature = "use_std")]
179178
mod duplicates_impl;
180179
mod exactly_one_err;
181-
#[cfg(feature = "use_std")]
180+
#[cfg(feature = "use_alloc")]
182181
mod extrema_set;
183182
mod flatten_ok;
184183
mod format;
@@ -2214,7 +2213,6 @@ pub trait Itertools: Iterator {
22142213
/// Ok(())
22152214
/// }
22162215
/// ```
2217-
#[cfg(feature = "use_alloc")]
22182216
fn try_collect<T, U, E>(self) -> Result<U, E>
22192217
where
22202218
Self: Sized + Iterator<Item = Result<T, E>>,
@@ -3171,7 +3169,7 @@ pub trait Itertools: Iterator {
31713169
///
31723170
/// The elements can be floats but no particular result is guaranteed
31733171
/// if an element is NaN.
3174-
#[cfg(feature = "use_std")]
3172+
#[cfg(feature = "use_alloc")]
31753173
fn min_set(self) -> Vec<Self::Item>
31763174
where
31773175
Self: Sized,
@@ -3204,7 +3202,7 @@ pub trait Itertools: Iterator {
32043202
///
32053203
/// The elements can be floats but no particular result is guaranteed
32063204
/// if an element is NaN.
3207-
#[cfg(feature = "use_std")]
3205+
#[cfg(feature = "use_alloc")]
32083206
fn min_set_by<F>(self, mut compare: F) -> Vec<Self::Item>
32093207
where
32103208
Self: Sized,
@@ -3236,7 +3234,7 @@ pub trait Itertools: Iterator {
32363234
///
32373235
/// The elements can be floats but no particular result is guaranteed
32383236
/// if an element is NaN.
3239-
#[cfg(feature = "use_std")]
3237+
#[cfg(feature = "use_alloc")]
32403238
fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
32413239
where
32423240
Self: Sized,
@@ -3268,7 +3266,7 @@ pub trait Itertools: Iterator {
32683266
///
32693267
/// The elements can be floats but no particular result is guaranteed
32703268
/// if an element is NaN.
3271-
#[cfg(feature = "use_std")]
3269+
#[cfg(feature = "use_alloc")]
32723270
fn max_set(self) -> Vec<Self::Item>
32733271
where
32743272
Self: Sized,
@@ -3301,7 +3299,7 @@ pub trait Itertools: Iterator {
33013299
///
33023300
/// The elements can be floats but no particular result is guaranteed
33033301
/// if an element is NaN.
3304-
#[cfg(feature = "use_std")]
3302+
#[cfg(feature = "use_alloc")]
33053303
fn max_set_by<F>(self, mut compare: F) -> Vec<Self::Item>
33063304
where
33073305
Self: Sized,
@@ -3333,7 +3331,7 @@ pub trait Itertools: Iterator {
33333331
///
33343332
/// The elements can be floats but no particular result is guaranteed
33353333
/// if an element is NaN.
3336-
#[cfg(feature = "use_std")]
3334+
#[cfg(feature = "use_alloc")]
33373335
fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
33383336
where
33393337
Self: Sized,

src/size_hint.rs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub fn add_scalar(sh: SizeHint, x: usize) -> SizeHint {
2929
}
3030

3131
/// Subtract `x` correctly from a `SizeHint`.
32+
#[cfg(feature = "use_alloc")]
3233
#[inline]
3334
pub fn sub_scalar(sh: SizeHint, x: usize) -> SizeHint {
3435
let (mut low, mut hi) = sh;

src/tuple_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ where
111111
// not yet produced as a tuple.
112112
let buffered = T::buffer_len(&self.buf);
113113
// To that, we must add the size estimates of the underlying iterator.
114-
let (mut unbuffered_lo, mut unbuffered_hi) = self.iter.size_hint();
114+
let (unbuffered_lo, unbuffered_hi) = self.iter.size_hint();
115115
// The total low estimate is the sum of the already-buffered elements,
116116
// plus the low estimate of remaining unbuffered elements, divided by
117117
// the tuple size.

tests/quick.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//!
44
//! In particular we test the tedious size_hint and exact size correctness.
55
6+
#![allow(deprecated, unstable_name_collisions)]
7+
68
use itertools::free::{
79
cloned, enumerate, multipeek, peek_nth, put_back, put_back_n, rciter, zip, zip_eq,
810
};

tests/specializations.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unstable_name_collisions)]
2+
13
use itertools::Itertools;
24
use quickcheck::quickcheck;
35
use std::fmt::Debug;

tests/test_core.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! option. This file may not be copied, modified, or distributed
55
//! except according to those terms.
66
#![no_std]
7+
#![allow(deprecated)]
78

89
use crate::it::chain;
910
use crate::it::free::put_back;

tests/test_std.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unstable_name_collisions)]
2+
13
use crate::it::cloned;
24
use crate::it::free::put_back_n;
35
use crate::it::free::rciter;

0 commit comments

Comments
 (0)