Skip to content

Commit 35cf2f9

Browse files
authored
Rollup merge of #40646 - russmack:issue-40435-mention-none, r=frewsxcv
Add mention of None as possible return. Closes #40435. This commit adds a small mention to some methods that None is returned when the slice is empty.
2 parents 9e11ecb + b77d31a commit 35cf2f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcollections/slice.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl<T> [T] {
230230
core_slice::SliceExt::first_mut(self)
231231
}
232232

233-
/// Returns the first and all the rest of the elements of a slice.
233+
/// Returns the first and all the rest of the elements of a slice, or `None` if it is empty.
234234
///
235235
/// # Examples
236236
///
@@ -248,7 +248,7 @@ impl<T> [T] {
248248
core_slice::SliceExt::split_first(self)
249249
}
250250

251-
/// Returns the first and all the rest of the elements of a slice.
251+
/// Returns the first and all the rest of the elements of a slice, or `None` if it is empty.
252252
///
253253
/// # Examples
254254
///
@@ -268,7 +268,7 @@ impl<T> [T] {
268268
core_slice::SliceExt::split_first_mut(self)
269269
}
270270

271-
/// Returns the last and all the rest of the elements of a slice.
271+
/// Returns the last and all the rest of the elements of a slice, or `None` if it is empty.
272272
///
273273
/// # Examples
274274
///
@@ -287,7 +287,7 @@ impl<T> [T] {
287287

288288
}
289289

290-
/// Returns the last and all the rest of the elements of a slice.
290+
/// Returns the last and all the rest of the elements of a slice, or `None` if it is empty.
291291
///
292292
/// # Examples
293293
///

0 commit comments

Comments
 (0)