Skip to content

Commit

Permalink
Improve sorting of comparison output
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Oct 20, 2024
1 parent f048ecd commit be00267
Show file tree
Hide file tree
Showing 12 changed files with 558 additions and 558 deletions.
2 changes: 1 addition & 1 deletion src/analyses/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub fn compare_rulesets<'a>(
}
}

complete.sort_by_key(|(req, _, _)| (req.depth(), *req));
complete.sort_by_key(|(req, _, _)| *req);
complete
}

Expand Down
18 changes: 9 additions & 9 deletions src/ast/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ impl Mutability {

#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum BindingMode {
ByRef(Mutability),
ByMove,
ByRef(Mutability),
}

impl BindingMode {
Expand All @@ -31,17 +31,17 @@ impl BindingMode {
/// A pattern.
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum Pattern<'a> {
/// The constructor for a type. Our only type is the tuple, represented as `[T, U]`, with its
/// constructor `[p, q]`.
Tuple(&'a [Self]),
/// `&p` or `&mut p`.
Ref(Mutability, &'a Self),
/// Bindings: `mut x`, `ref mut x`, etc. We allow things like `mut ref mut x` that aren't
/// representable in today's rust.
Binding(Mutability, BindingMode, &'a str),
/// An abstract pattern, meant as a placeholder for some unknown pattern. Used only when
/// exploring possible rules.
Abstract(&'a str),
/// Bindings: `mut x`, `ref mut x`, etc. We allow things like `mut ref mut x` that aren't
/// representable in today's rust.
Binding(Mutability, BindingMode, &'a str),
/// `&p` or `&mut p`.
Ref(Mutability, &'a Self),
/// The constructor for a type. Our only type is the tuple, represented as `[T, U]`, with its
/// constructor `[p, q]`.
Tuple(&'a [Self]),
}

/// A type.
Expand Down
Loading

0 comments on commit be00267

Please sign in to comment.