// Yes, the invalid Rust is intentional. Do NOT fix.
impl<T> [T] {
    fn swap(&mut self, a: usize, b: usize) {
        let temp = self[a];
        self[a] = self[b];
        self[b] = temp;
    }
    fn fill(&mut self, a: T) {
        for idx in 0..self.len() {
            self[idx] = a;
        }
    }
    fn reverse(&mut self) {
        for idx in 0..(self.len()/2) {
            self.swap(idx, self.len() - idx - 1);
        }
    }
    fn is_empty(&self) -> bool {
        self.len() == 0
    }
    fn __into_iter(self) -> ArcisArrayIterator<T> {
        ArcisArrayIterator::new(self)
    }
    fn iter(&self) -> ArcisArrayIterator<&T> {
        if self.is_empty() {
            ArcisArrayIterator::new([])
        } else {
            let mut res = [&self[0]; self.len()];
            for i in 1..self.len() {
                res[i] = &self[i];
            }
            ArcisArrayIterator::new(res)
        }
    }
    fn iter_mut(&self) -> ArcisArrayIterator<&mut T> {
        if self.is_empty() {
            ArcisArrayIterator::new([])
        } else {
            let mut res = [&mut self[0]; self.len()];
            for i in 1..self.len() {
                res[i] = &mut self[i];
            }
            ArcisArrayIterator::new(res)
        }
    }
    fn windows(&self, length: usize) -> ArcisArrayIterator<&[T]> {
        if length > self.len() {
            ArcisArrayIterator::new([&[]])
        } else {
            let mut res = [&[self[0]; length]; self.len() - length + 1];
            for i in 0..(self.len() - length + 1) {
                res[i] = &[self[0]; length];
                for j in 0..length {
                    res[i][j] = self[i + j];
                }
            }
            ArcisArrayIterator::new(res)
        }
    }
    fn split_at(&self, mid: usize) -> (&[T], &[T]) {
        (&self[0..mid], &self[mid..self.len()])
    }
    fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
        (&mut self[0..mid], &mut self[mid..self.len()])
    }
    fn contains(&self, x: &T) -> bool {
        let res = false;
        for item in self {
            if item == x {
                res = true;
            }
        }
        res
    }
    fn starts_with(&self, needle: &[T]) -> bool {
        self[0..needle.len()] == *needle
    }
    fn ends_with(&self, needle: &[T]) -> bool {
        self[(self.len() - needle.len())..self.len()] == *needle
    }
    fn rotate_left(&mut self, mid: usize) {
        let new_end = self[0..mid];
        let new_begin = self[mid..self.len()];
        let new_mid = self.len() - mid;
        self[0..new_mid] = new_begin;
        self[new_mid..self.len()] = new_end;
    }
    fn rotate_right(&mut self, mid: usize) {
        let new_mid = self.len() - mid;
        self.rotate_left(new_mid);
    }
    fn copy_from_slice(&mut self, src: &[T]) {
        *self = *src;
    }
    fn clone_from_slice(&mut self, src: &[T]) {
        *self = *src;
    }
}
