about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClément Renault <clement@meilisearch.com>2020-12-10 19:10:09 +0100
committerClément Renault <clement@meilisearch.com>2020-12-10 19:44:37 +0100
commit7952ea5a04aa34dc5441a47f7d4d227193c8fdf6 (patch)
tree1fbb0c9643172fd64edbd070157ec205db979c6f
parent45693b43a5e779545cf6c6af909ab5c27d94e4c8 (diff)
downloadrust-7952ea5a04aa34dc5441a47f7d4d227193c8fdf6.tar.gz
rust-7952ea5a04aa34dc5441a47f7d4d227193c8fdf6.zip
Fix the fmt issues
-rw-r--r--library/alloc/src/slice.rs4
-rw-r--r--library/core/src/slice/iter.rs31
-rw-r--r--library/core/src/slice/mod.rs6
3 files changed, 20 insertions, 21 deletions
diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs
index 5f92dfe539f..72da781da3c 100644
--- a/library/alloc/src/slice.rs
+++ b/library/alloc/src/slice.rs
@@ -110,6 +110,8 @@ pub use core::slice::{Chunks, Windows};
 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::{RChunks, RChunksExact, RChunksExactMut, RChunksMut};
 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
diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs
index a10ebacf5fb..423cbd11350 100644
--- a/library/core/src/slice/iter.rs
+++ b/library/core/src/slice/iter.rs
@@ -2991,7 +2991,8 @@ impl<'a, T: 'a, P> GroupBy<'a, T, P> {
 
 #[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 @@ where P: FnMut(&T, &T) -> bool,
 
     #[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 @@ where P: FnMut(&T, &T) -> bool,
 
 #[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 @@ where P: FnMut(&T, &T) -> bool,
 }
 
 #[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 @@ impl<'a, T: 'a, P> GroupByMut<'a, T, P> {
 
 #[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 @@ where P: FnMut(&T, &T) -> bool,
 
     #[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 @@ where P: FnMut(&T, &T) -> bool,
 
 #[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 @@ where P: FnMut(&T, &T) -> bool,
         }
     }
 }
+
+#[unstable(feature = "slice_group_by", issue = "none")]
+impl<'a, T: 'a, P> FusedIterator for GroupByMut<'a, T, P> where P: FnMut(&T, &T) -> bool {}
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 218cd2c25a2..648cf88b7ef 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -1234,7 +1234,8 @@ impl<T> [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 @@ impl<T> [T] {
     #[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)
     }