<commit_before># Slice methods - https://doc.rust-lang.org/std/primitive.slice.html
Slices are either mutable or shared. The shared slice type is &[T], while the mutable slice type is &mut [T]

### Construction
* **fn clone_from_slice(&mut self, src: &[T])**       Copies the elements from src into self. The length of src must be the same as self.
* **fn copy_from_slice(&mut self, src: &[T])**        Copies all elements from src into self, using a memcpy. The length of src must be the same as self.
* **fn to_vec(&self) -> Vec<T>**                      Copies self into a new Vec.
* **fn into_vec(self: Box<[T]>) -> Vec<T>**           Converts self into a vector without clones or allocation.
* **fn to_owned(&self) -> Vec<T>**                    Creates owned data from borrowed data, usually by cloning.

### Queries
fn len(&self) -> usize                          Returns the number of elements in the slice.
fn is_empty(&self) -> bool                      Returns true if the slice contains no elements.
fn contains(&self, x: &T) -> bool               Returns true if the slice contains an element with the given value.
fn starts_with(&self, needle: &[T]) -> bool     Returns true if needle is a prefix of the slice.
fn ends_with(&self, needle: &[T]) -> bool       Returns true if needle is a suffix of the slice.
fn binary_search(&self, x: &T) -> Result<usize, usize>                              Binary searches this sorted slice for a given element.
fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>                  Binary searches this sorted slice with a comparator function.
fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<usize, usize>    Binary searches this sorted slice with a key extraction function.

### Element Access & Change
fn first(&self) -> Option<&T>                   Returns the first element of the slice, or None if it is empty.
fn first_mut(&mut self) -> Option<&mut T>       Returns a mutable pointer to the first element of the slice, or None if it is empty.
fn last(&self) -> Option<&T>                    Returns the last element of the slice, or None if it is empty.
fn last_mut(&mut self) -> Option<&mut T>        Returns a mutable pointer to the last item in the slice.
fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>                   Returns a reference to an element or subslice depending on the type of index.<commit_msg>Rust: try formatting change. (reverted from commit ced6983475b9a18a8693dd485ba0dcaf2c09afb3)<commit_after># Slice methods - https://doc.rust-lang.org/std/primitive.slice.html
Slices are either mutable or shared. The shared slice type is &[T], while the mutable slice type is &mut [T]

### Construction
* fn clone_from_slice(&mut self, src: &[T])       Copies the elements from src into self. The length of src must be the same as self.
* fn copy_from_slice(&mut self, src: &[T])        Copies all elements from src into self, using a memcpy. The length of src must be the same as self.
* fn to_vec(&self) -> Vec<T>                      Copies self into a new Vec.
* fn into_vec(self: Box<[T]>) -> Vec<T>           Converts self into a vector without clones or allocation.
* fn to_owned(&self) -> Vec<T>                    Creates owned data from borrowed data, usually by cloning.

### Queries
fn len(&self) -> usize                          Returns the number of elements in the slice.
fn is_empty(&self) -> bool                      Returns true if the slice contains no elements.
fn contains(&self, x: &T) -> bool               Returns true if the slice contains an element with the given value.
fn starts_with(&self, needle: &[T]) -> bool     Returns true if needle is a prefix of the slice.
fn ends_with(&self, needle: &[T]) -> bool       Returns true if needle is a suffix of the slice.
fn binary_search(&self, x: &T) -> Result<usize, usize>                              Binary searches this sorted slice for a given element.
fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>                  Binary searches this sorted slice with a comparator function.
fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<usize, usize>    Binary searches this sorted slice with a key extraction function.

### Element Access & Change
fn first(&self) -> Option<&T>                   Returns the first element of the slice, or None if it is empty.
fn first_mut(&mut self) -> Option<&mut T>       Returns a mutable pointer to the first element of the slice, or None if it is empty.
fn last(&self) -> Option<&T>                    Returns the last element of the slice, or None if it is empty.
fn last_mut(&mut self) -> Option<&mut T>        Returns a mutable pointer to the last item in the slice.
fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>                   Returns a reference to an element or subslice depending on the type of index.
{'fraction_non_alphanumeric': 0.10230283268799674, 'fraction_numerical': 0.004483391073975953, 'mean_word_length': 2.760919540229885, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 69, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2472260', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1376, 'n_words': 652}