Skip to main content

luaur_analysis/methods/
cannot_assign_to_never_operator_eq.rs

1use crate::records::cannot_assign_to_never::CannotAssignToNever;
2
3impl CannotAssignToNever {
4    #[inline]
5    pub fn operator_eq(&self, rhs: &CannotAssignToNever) -> bool {
6        if self.cause.len() != rhs.cause.len() {
7            return false;
8        }
9
10        for i in 0..self.cause.len() {
11            if self.cause[i] != rhs.cause[i] {
12                return false;
13            }
14        }
15
16        self.rhsType == rhs.rhsType && self.reason == rhs.reason
17    }
18}