]> git.lizzy.rs Git - rust.git/commitdiff
Add mention of None as possible return. Closes #40435.
authorRussell Mackenzie <russmackdev@gmail.com>
Sun, 19 Mar 2017 01:39:11 +0000 (01:39 +0000)
committerRussell Mackenzie <russmackdev@gmail.com>
Sun, 19 Mar 2017 01:41:44 +0000 (01:41 +0000)
src/libcollections/slice.rs

index 11fc1d553f28e7a60bda0b2eee9989fd6a0838cd..8147b83cf0487a863ce937a31f2edbe2d9f0cd31 100644 (file)
@@ -230,7 +230,7 @@ pub fn first_mut(&mut self) -> Option<&mut T> {
         core_slice::SliceExt::first_mut(self)
     }
 
-    /// Returns the first and all the rest of the elements of a slice.
+    /// Returns the first and all the rest of the elements of a slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -248,7 +248,7 @@ pub fn split_first(&self) -> Option<(&T, &[T])> {
         core_slice::SliceExt::split_first(self)
     }
 
-    /// Returns the first and all the rest of the elements of a slice.
+    /// Returns the first and all the rest of the elements of a slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -268,7 +268,7 @@ pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])> {
         core_slice::SliceExt::split_first_mut(self)
     }
 
-    /// Returns the last and all the rest of the elements of a slice.
+    /// Returns the last and all the rest of the elements of a slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -287,7 +287,7 @@ pub fn split_last(&self) -> Option<(&T, &[T])> {
 
     }
 
-    /// Returns the last and all the rest of the elements of a slice.
+    /// Returns the last and all the rest of the elements of a slice, or `None` if it is empty.
     ///
     /// # Examples
     ///