1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pub trait ArrayStrEqual {
    fn equal(&self, arr: &[String]) -> bool;
}

impl<const N: usize> ArrayStrEqual for [&str; N] {
    fn equal(&self, arr: &[String]) -> bool {
        self.iter().eq(arr.iter())
    }
}

impl<const N: usize> ArrayStrEqual for &[&str; N] {
    fn equal(&self, arr: &[String]) -> bool {
        self.iter().eq(arr.iter())
    }
}

pub fn array_str_equal(arr_str: &[&str], arr_string: &[&str]) -> bool {
    arr_str.iter().all(|e| arr_string.contains(e))
}