Skip to content

Commit 7952ea5

Browse files
committed
Fix the fmt issues
1 parent 45693b4 commit 7952ea5

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

library/alloc/src/slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ pub use core::slice::{Chunks, Windows};
110110
pub use core::slice::{ChunksExact, ChunksExactMut};
111111
#[stable(feature = "rust1", since = "1.0.0")]
112112
pub use core::slice::{ChunksMut, Split, SplitMut};
113+
#[unstable(feature = "slice_group_by", issue = "none")]
114+
pub use core::slice::{GroupBy, GroupByMut};
113115
#[stable(feature = "rust1", since = "1.0.0")]
114116
pub use core::slice::{Iter, IterMut};
115117
#[stable(feature = "rchunks", since = "1.31.0")]
@@ -118,8 +120,6 @@ pub use core::slice::{RChunks, RChunksExact, RChunksExactMut, RChunksMut};
118120
pub use core::slice::{RSplit, RSplitMut};
119121
#[stable(feature = "rust1", since = "1.0.0")]
120122
pub use core::slice::{RSplitN, RSplitNMut, SplitN, SplitNMut};
121-
#[unstable(feature = "slice_group_by", issue = "none")]
122-
pub use core::slice::{GroupBy, GroupByMut};
123123

124124
////////////////////////////////////////////////////////////////////////////////
125125
// Basic slice extension methods

library/core/src/slice/iter.rs

+14-17
Original file line numberDiff line numberDiff line change
@@ -2991,7 +2991,8 @@ impl<'a, T: 'a, P> GroupBy<'a, T, P> {
29912991

29922992
#[unstable(feature = "slice_group_by", issue = "none")]
29932993
impl<'a, T: 'a, P> Iterator for GroupBy<'a, T, P>
2994-
where P: FnMut(&T, &T) -> bool,
2994+
where
2995+
P: FnMut(&T, &T) -> bool,
29952996
{
29962997
type Item = &'a [T];
29972998

@@ -3013,11 +3014,7 @@ where P: FnMut(&T, &T) -> bool,
30133014

30143015
#[inline]
30153016
fn size_hint(&self) -> (usize, Option<usize>) {
3016-
if self.slice.is_empty() {
3017-
(0, Some(0))
3018-
} else {
3019-
(1, Some(self.slice.len()))
3020-
}
3017+
if self.slice.is_empty() { (0, Some(0)) } else { (1, Some(self.slice.len())) }
30213018
}
30223019

30233020
#[inline]
@@ -3028,7 +3025,8 @@ where P: FnMut(&T, &T) -> bool,
30283025

30293026
#[unstable(feature = "slice_group_by", issue = "none")]
30303027
impl<'a, T: 'a, P> DoubleEndedIterator for GroupBy<'a, T, P>
3031-
where P: FnMut(&T, &T) -> bool,
3028+
where
3029+
P: FnMut(&T, &T) -> bool,
30323030
{
30333031
#[inline]
30343032
fn next_back(&mut self) -> Option<Self::Item> {
@@ -3048,9 +3046,7 @@ where P: FnMut(&T, &T) -> bool,
30483046
}
30493047

30503048
#[unstable(feature = "slice_group_by", issue = "none")]
3051-
impl<'a, T: 'a, P> FusedIterator for GroupBy<'a, T, P>
3052-
where P: FnMut(&T, &T) -> bool,
3053-
{ }
3049+
impl<'a, T: 'a, P> FusedIterator for GroupBy<'a, T, P> where P: FnMut(&T, &T) -> bool {}
30543050

30553051
/// An iterator over slice in (non-overlapping) mutable chunks separated
30563052
/// by a predicate.
@@ -3075,7 +3071,8 @@ impl<'a, T: 'a, P> GroupByMut<'a, T, P> {
30753071

30763072
#[unstable(feature = "slice_group_by", issue = "none")]
30773073
impl<'a, T: 'a, P> Iterator for GroupByMut<'a, T, P>
3078-
where P: FnMut(&T, &T) -> bool,
3074+
where
3075+
P: FnMut(&T, &T) -> bool,
30793076
{
30803077
type Item = &'a mut [T];
30813078

@@ -3098,11 +3095,7 @@ where P: FnMut(&T, &T) -> bool,
30983095

30993096
#[inline]
31003097
fn size_hint(&self) -> (usize, Option<usize>) {
3101-
if self.slice.is_empty() {
3102-
(0, Some(0))
3103-
} else {
3104-
(1, Some(self.slice.len()))
3105-
}
3098+
if self.slice.is_empty() { (0, Some(0)) } else { (1, Some(self.slice.len())) }
31063099
}
31073100

31083101
#[inline]
@@ -3113,7 +3106,8 @@ where P: FnMut(&T, &T) -> bool,
31133106

31143107
#[unstable(feature = "slice_group_by", issue = "none")]
31153108
impl<'a, T: 'a, P> DoubleEndedIterator for GroupByMut<'a, T, P>
3116-
where P: FnMut(&T, &T) -> bool,
3109+
where
3110+
P: FnMut(&T, &T) -> bool,
31173111
{
31183112
#[inline]
31193113
fn next_back(&mut self) -> Option<Self::Item> {
@@ -3132,3 +3126,6 @@ where P: FnMut(&T, &T) -> bool,
31323126
}
31333127
}
31343128
}
3129+
3130+
#[unstable(feature = "slice_group_by", issue = "none")]
3131+
impl<'a, T: 'a, P> FusedIterator for GroupByMut<'a, T, P> where P: FnMut(&T, &T) -> bool {}

library/core/src/slice/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,8 @@ impl<T> [T] {
12341234
#[unstable(feature = "slice_group_by", issue = "none")]
12351235
#[inline]
12361236
pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>
1237-
where F: FnMut(&T, &T) -> bool
1237+
where
1238+
F: FnMut(&T, &T) -> bool,
12381239
{
12391240
GroupBy::new(self, pred)
12401241
}
@@ -1263,7 +1264,8 @@ impl<T> [T] {
12631264
#[unstable(feature = "slice_group_by", issue = "none")]
12641265
#[inline]
12651266
pub fn group_by_mut<F>(&mut self, pred: F) -> GroupByMut<'_, T, F>
1266-
where F: FnMut(&T, &T) -> bool
1267+
where
1268+
F: FnMut(&T, &T) -> bool,
12671269
{
12681270
GroupByMut::new(self, pred)
12691271
}

0 commit comments

Comments
 (0)