rust/library/core/src/slice
Matthias Krüger ed75229a97
Rollup merge of #121343 - Takashiidobe:takashi/examples-for-slice, r=Mark-Simulacrum
Add examples for some methods on slices

Adds some examples to some methods on slice.

`is_empty` didn't have an example for an empty slice, even though `str` and the collections all have one, so I added that in.

`first_mut` and `last_mut` didn't have an example for what happens when the slice is empty, whereas `first` and `last` do, so I added that too.
2024-02-24 22:38:58 +01:00
..
iter Replace NonZero::<_>::new with NonZero::new. 2024-02-15 08:09:42 +01:00
ascii.rs Rollup merge of #113142 - the8472:opt-cstr-display, r=Mark-Simulacrum 2024-01-20 09:37:25 +01:00
cmp.rs Use <T, U> for array/slice equality impls 2024-01-26 12:40:04 -05:00
index.rs Add more inline(always) to fix opt-level=z test on wasm32 2024-02-19 20:38:11 -05:00
iter.rs rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
memchr.rs Use usize::repeat_u8 instead of implementing repeat_byte in memchr.rs 2023-11-26 12:27:56 +00:00
mod.rs Rollup merge of #121343 - Takashiidobe:takashi/examples-for-slice, r=Mark-Simulacrum 2024-02-24 22:38:58 +01:00
raw.rs Rewrite assert_unsafe_precondition around the new intrinsic 2024-02-08 11:52:14 -05:00
rotate.rs Make ZST checks in core/alloc more readable 2022-09-22 23:12:29 -07:00
select.rs Use helper functions for min/max_idx 2023-05-24 19:33:04 +00:00
sort.rs Avoid unnecessary comparison in partition_equal 2023-10-25 19:37:14 +02:00
specialize.rs Remove size_of == 1 case from fill specialization. 2021-08-09 19:25:28 +02:00