Fix the fmt issues

This commit is contained in:
Clément Renault
2020-12-10 19:10:09 +01:00
parent 45693b43a5
commit 7952ea5a04
3 changed files with 20 additions and 21 deletions
+2 -2
View File
@@ -110,6 +110,8 @@
pub use core::slice::{ChunksExact, ChunksExactMut};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::slice::{ChunksMut, Split, SplitMut};
#[unstable(feature = "slice_group_by", issue = "none")]
pub use core::slice::{GroupBy, GroupByMut};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::slice::{Iter, IterMut};
#[stable(feature = "rchunks", since = "1.31.0")]
@@ -118,8 +120,6 @@
pub use core::slice::{RSplit, RSplitMut};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::slice::{RSplitN, RSplitNMut, SplitN, SplitNMut};
#[unstable(feature = "slice_group_by", issue = "none")]
pub use core::slice::{GroupBy, GroupByMut};
////////////////////////////////////////////////////////////////////////////////
// Basic slice extension methods
+14 -17
View File
@@ -2991,7 +2991,8 @@ pub(super) fn new(slice: &'a [T], predicate: P) -> Self {
#[unstable(feature = "slice_group_by", issue = "none")]
impl<'a, T: 'a, P> Iterator for GroupBy<'a, T, P>
where P: FnMut(&T, &T) -> bool,
where
P: FnMut(&T, &T) -> bool,
{
type Item = &'a [T];
@@ -3013,11 +3014,7 @@ fn next(&mut self) -> Option<Self::Item> {
#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
if self.slice.is_empty() {
(0, Some(0))
} else {
(1, Some(self.slice.len()))
}
if self.slice.is_empty() { (0, Some(0)) } else { (1, Some(self.slice.len())) }
}
#[inline]
@@ -3028,7 +3025,8 @@ fn last(mut self) -> Option<Self::Item> {
#[unstable(feature = "slice_group_by", issue = "none")]
impl<'a, T: 'a, P> DoubleEndedIterator for GroupBy<'a, T, P>
where P: FnMut(&T, &T) -> bool,
where
P: FnMut(&T, &T) -> bool,
{
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
@@ -3048,9 +3046,7 @@ fn next_back(&mut self) -> Option<Self::Item> {
}
#[unstable(feature = "slice_group_by", issue = "none")]
impl<'a, T: 'a, P> FusedIterator for GroupBy<'a, T, P>
where P: FnMut(&T, &T) -> bool,
{ }
impl<'a, T: 'a, P> FusedIterator for GroupBy<'a, T, P> where P: FnMut(&T, &T) -> bool {}
/// An iterator over slice in (non-overlapping) mutable chunks separated
/// by a predicate.
@@ -3075,7 +3071,8 @@ pub(super) fn new(slice: &'a mut [T], predicate: P) -> Self {
#[unstable(feature = "slice_group_by", issue = "none")]
impl<'a, T: 'a, P> Iterator for GroupByMut<'a, T, P>
where P: FnMut(&T, &T) -> bool,
where
P: FnMut(&T, &T) -> bool,
{
type Item = &'a mut [T];
@@ -3098,11 +3095,7 @@ fn next(&mut self) -> Option<Self::Item> {
#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
if self.slice.is_empty() {
(0, Some(0))
} else {
(1, Some(self.slice.len()))
}
if self.slice.is_empty() { (0, Some(0)) } else { (1, Some(self.slice.len())) }
}
#[inline]
@@ -3113,7 +3106,8 @@ fn last(mut self) -> Option<Self::Item> {
#[unstable(feature = "slice_group_by", issue = "none")]
impl<'a, T: 'a, P> DoubleEndedIterator for GroupByMut<'a, T, P>
where P: FnMut(&T, &T) -> bool,
where
P: FnMut(&T, &T) -> bool,
{
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
@@ -3132,3 +3126,6 @@ fn next_back(&mut self) -> Option<Self::Item> {
}
}
}
#[unstable(feature = "slice_group_by", issue = "none")]
impl<'a, T: 'a, P> FusedIterator for GroupByMut<'a, T, P> where P: FnMut(&T, &T) -> bool {}
+4 -2
View File
@@ -1234,7 +1234,8 @@ pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>
#[unstable(feature = "slice_group_by", issue = "none")]
#[inline]
pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>
where F: FnMut(&T, &T) -> bool
where
F: FnMut(&T, &T) -> bool,
{
GroupBy::new(self, pred)
}
@@ -1263,7 +1264,8 @@ pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>
#[unstable(feature = "slice_group_by", issue = "none")]
#[inline]
pub fn group_by_mut<F>(&mut self, pred: F) -> GroupByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool
where
F: FnMut(&T, &T) -> bool,
{
GroupByMut::new(self, pred)
}