(a: &[A], b: &[B])
| 1 | use crate::auth::consts::SCOPES; |
| 2 | |
| 3 | pub fn scopes_match<A: AsRef<str>, B: AsRef<str>>(a: &[A], b: &[B]) -> bool { |
| 4 | if a.len() != b.len() { |
| 5 | return false; |
| 6 | } |
| 7 | |
| 8 | let mut a = a.iter().map(|s| s.as_ref()).collect::<Vec<_>>(); |
| 9 | let mut b = b.iter().map(|s| s.as_ref()).collect::<Vec<_>>(); |
| 10 | a.sort(); |
| 11 | b.sort(); |
| 12 | a == b |
| 13 | } |
| 14 | |
| 15 | /// Checks if the given scopes match the predefined scopes. |
| 16 | pub(crate) fn is_scopes<S: AsRef<str>>(scopes: &[S]) -> bool { |