Skip to content

Commit 9150cab

Browse files
authored
Reverted formatting
changes
1 parent e75a656 commit 9150cab

File tree

1 file changed

+43
-53
lines changed

1 file changed

+43
-53
lines changed

src/free.rs

Lines changed: 43 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,30 @@ use std::iter::{self, Zip};
1010
type VecIntoIter<T> = alloc::vec::IntoIter<T>;
1111

1212
#[cfg(feature = "use_alloc")]
13-
use alloc::string::String;
13+
use alloc::{
14+
string::String,
15+
};
1416

15-
use crate::intersperse::{Intersperse, IntersperseWith};
1617
use crate::Itertools;
18+
use crate::intersperse::{Intersperse, IntersperseWith};
1719

18-
pub use crate::adaptors::{interleave, merge, put_back};
20+
pub use crate::adaptors::{
21+
interleave,
22+
merge,
23+
put_back,
24+
};
1925
#[cfg(feature = "use_alloc")]
20-
pub use crate::kmerge_impl::kmerge;
21-
pub use crate::merge_join::merge_join_by;
26+
pub use crate::put_back_n_impl::put_back_n;
2227
#[cfg(feature = "use_alloc")]
2328
pub use crate::multipeek_impl::multipeek;
2429
#[cfg(feature = "use_alloc")]
2530
pub use crate::peek_nth::peek_nth;
2631
#[cfg(feature = "use_alloc")]
27-
pub use crate::put_back_n_impl::put_back_n;
32+
pub use crate::kmerge_impl::kmerge;
33+
pub use crate::zip_eq_impl::zip_eq;
34+
pub use crate::merge_join::merge_join_by;
2835
#[cfg(feature = "use_alloc")]
2936
pub use crate::rciter_impl::rciter;
30-
pub use crate::zip_eq_impl::zip_eq;
3137

3238
/// Iterate `iterable` with a particular value inserted between each element.
3339
///
@@ -39,9 +45,8 @@ pub use crate::zip_eq_impl::zip_eq;
3945
/// itertools::assert_equal(intersperse((0..3), 8), vec![0, 8, 1, 8, 2]);
4046
/// ```
4147
pub fn intersperse<I>(iterable: I, element: I::Item) -> Intersperse<I::IntoIter>
42-
where
43-
I: IntoIterator,
44-
<I as IntoIterator>::Item: Clone,
48+
where I: IntoIterator,
49+
<I as IntoIterator>::Item: Clone
4550
{
4651
Itertools::intersperse(iterable.into_iter(), element)
4752
}
@@ -59,9 +64,8 @@ where
5964
/// assert_eq!(i, 8);
6065
/// ```
6166
pub fn intersperse_with<I, F>(iterable: I, element: F) -> IntersperseWith<I::IntoIter, F>
62-
where
63-
I: IntoIterator,
64-
F: FnMut() -> I::Item,
67+
where I: IntoIterator,
68+
F: FnMut() -> I::Item
6569
{
6670
Itertools::intersperse_with(iterable.into_iter(), element)
6771
}
@@ -78,8 +82,7 @@ where
7882
/// }
7983
/// ```
8084
pub fn enumerate<I>(iterable: I) -> iter::Enumerate<I::IntoIter>
81-
where
82-
I: IntoIterator,
85+
where I: IntoIterator
8386
{
8487
iterable.into_iter().enumerate()
8588
}
@@ -96,9 +99,8 @@ where
9699
/// }
97100
/// ```
98101
pub fn rev<I>(iterable: I) -> iter::Rev<I::IntoIter>
99-
where
100-
I: IntoIterator,
101-
I::IntoIter: DoubleEndedIterator,
102+
where I: IntoIterator,
103+
I::IntoIter: DoubleEndedIterator
102104
{
103105
iterable.into_iter().rev()
104106
}
@@ -119,11 +121,9 @@ where
119121
/// }
120122
/// assert_eq!(result, vec![(1, 'a'),(2, 'b'),(3, 'c')]);
121123
/// ```
122-
///
123124
pub fn zip<I, J>(i: I, j: J) -> Zip<I::IntoIter, J::IntoIter>
124-
where
125-
I: IntoIterator,
126-
J: IntoIterator,
125+
where I: IntoIterator,
126+
J: IntoIterator
127127
{
128128
i.into_iter().zip(j)
129129
}
@@ -139,13 +139,9 @@ where
139139
/// /* loop body */
140140
/// }
141141
/// ```
142-
pub fn chain<I, J>(
143-
i: I,
144-
j: J,
145-
) -> iter::Chain<<I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter>
146-
where
147-
I: IntoIterator,
148-
J: IntoIterator<Item = I::Item>,
142+
pub fn chain<I, J>(i: I, j: J) -> iter::Chain<<I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter>
143+
where I: IntoIterator,
144+
J: IntoIterator<Item = I::Item>
149145
{
150146
i.into_iter().chain(j)
151147
}
@@ -160,9 +156,8 @@ where
160156
/// assert_eq!(cloned(b"abc").next(), Some(b'a'));
161157
/// ```
162158
pub fn cloned<'a, I, T: 'a>(iterable: I) -> iter::Cloned<I::IntoIter>
163-
where
164-
I: IntoIterator<Item = &'a T>,
165-
T: Clone,
159+
where I: IntoIterator<Item=&'a T>,
160+
T: Clone,
166161
{
167162
iterable.into_iter().cloned()
168163
}
@@ -177,9 +172,8 @@ where
177172
/// assert_eq!(fold(&[1., 2., 3.], 0., |a, &b| f32::max(a, b)), 3.);
178173
/// ```
179174
pub fn fold<I, B, F>(iterable: I, init: B, f: F) -> B
180-
where
181-
I: IntoIterator,
182-
F: FnMut(B, I::Item) -> B,
175+
where I: IntoIterator,
176+
F: FnMut(B, I::Item) -> B
183177
{
184178
iterable.into_iter().fold(init, f)
185179
}
@@ -194,9 +188,8 @@ where
194188
/// assert!(all(&[1, 2, 3], |elt| *elt > 0));
195189
/// ```
196190
pub fn all<I, F>(iterable: I, f: F) -> bool
197-
where
198-
I: IntoIterator,
199-
F: FnMut(I::Item) -> bool,
191+
where I: IntoIterator,
192+
F: FnMut(I::Item) -> bool
200193
{
201194
iterable.into_iter().all(f)
202195
}
@@ -211,9 +204,8 @@ where
211204
/// assert!(any(&[0, -1, 2], |elt| *elt > 0));
212205
/// ```
213206
pub fn any<I, F>(iterable: I, f: F) -> bool
214-
where
215-
I: IntoIterator,
216-
F: FnMut(I::Item) -> bool,
207+
where I: IntoIterator,
208+
F: FnMut(I::Item) -> bool
217209
{
218210
iterable.into_iter().any(f)
219211
}
@@ -228,9 +220,8 @@ where
228220
/// assert_eq!(max(0..10), Some(9));
229221
/// ```
230222
pub fn max<I>(iterable: I) -> Option<I::Item>
231-
where
232-
I: IntoIterator,
233-
I::Item: Ord,
223+
where I: IntoIterator,
224+
I::Item: Ord
234225
{
235226
iterable.into_iter().max()
236227
}
@@ -245,13 +236,13 @@ where
245236
/// assert_eq!(min(0..10), Some(0));
246237
/// ```
247238
pub fn min<I>(iterable: I) -> Option<I::Item>
248-
where
249-
I: IntoIterator,
250-
I::Item: Ord,
239+
where I: IntoIterator,
240+
I::Item: Ord
251241
{
252242
iterable.into_iter().min()
253243
}
254244

245+
255246
/// Combine all iterator elements into one String, separated by `sep`.
256247
///
257248
/// [`IntoIterator`] enabled version of [`Itertools::join`].
@@ -263,9 +254,8 @@ where
263254
/// ```
264255
#[cfg(feature = "use_alloc")]
265256
pub fn join<I>(iterable: I, sep: &str) -> String
266-
where
267-
I: IntoIterator,
268-
I::Item: Display,
257+
where I: IntoIterator,
258+
I::Item: Display
269259
{
270260
iterable.into_iter().join(sep)
271261
}
@@ -282,9 +272,9 @@ where
282272
/// ```
283273
#[cfg(feature = "use_alloc")]
284274
pub fn sorted<I>(iterable: I) -> VecIntoIter<I::Item>
285-
where
286-
I: IntoIterator,
287-
I::Item: Ord,
275+
where I: IntoIterator,
276+
I::Item: Ord
288277
{
289278
iterable.into_iter().sorted()
290279
}
280+

0 commit comments

Comments
 (0)