Skip to main content

luaur_analysis/methods/
warning_comparator_compare_linter_alt_b.rs

1use crate::records::warning_comparator::WarningComparator;
2use luaur_ast::records::location::Location;
3
4impl WarningComparator {
5    #[inline]
6    pub fn compare_location_location(&self, lhs: &Location, rhs: &Location) -> i32 {
7        let c = self.compare_position_position(&lhs.begin, &rhs.begin);
8        if c != 0 {
9            return c;
10        }
11
12        let c = self.compare_position_position(&lhs.end, &rhs.end);
13        if c != 0 {
14            return c;
15        }
16
17        0
18    }
19}