Function show_notes::e013::refs_all_around
source · pub fn refs_all_around<'a>(input: &'a [i32]) -> Option<&'a [i32]>
Expand description
Get a(n optional) sub-slice of a slice.
Note that here we have a reference coming both directions, and therefore lifetimes on both the input and the output. These can be elided, but are left here for illustrative purposes!
What we’re doing here is returning a reference to everything but the “head” of the slice. Since the slice might be empty, or might have only one element, we treat this as an optional.