File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 7
7
A slice is a [ dynamically sized type] representing a 'view' into a sequence of
8
8
elements of type ` T ` . The slice type is written as ` [T] ` .
9
9
10
- To use a slice type it generally has to be used behind a pointer for example
11
- as:
10
+ Slice types are generally used through pointer types. For example:
12
11
13
- * ` &[T] ` , a 'shared slice', often just called a 'slice', it doesn't own the
14
- data it points to, it borrows it.
15
- * ` &mut [T] ` , a 'mutable slice', mutably borrows the data it points to.
16
- * ` Box<[T]> ` , a 'boxed slice'
12
+ * ` &[T] ` : a 'shared slice', often just called a 'slice'. It doesn't own the
13
+ data it points to; it borrows it.
14
+ * ` &mut [T] ` : a 'mutable slice'. It mutably borrows the data it points to.
15
+ * ` Box<[T]> ` : a 'boxed slice'
17
16
18
17
Examples:
19
18
You can’t perform that action at this time.
0 commit comments