1
Fork 0

Replace AssocOp::DotDot{,Eq} with AssocOp::Range.

It makes `AssocOp` more similar to `ExprKind` and makes things a little
simpler. And the semantic names make more sense here than the syntactic
names.
This commit is contained in:
Nicholas Nethercote 2024-12-19 21:42:46 +11:00
parent ceafbad81f
commit fc8e87b274
4 changed files with 32 additions and 43 deletions

View file

@ -1453,6 +1453,15 @@ pub enum RangeLimits {
Closed,
}
impl RangeLimits {
pub fn as_str(&self) -> &'static str {
match self {
RangeLimits::HalfOpen => "..",
RangeLimits::Closed => "..=",
}
}
}
/// A method call (e.g. `x.foo::<Bar, Baz>(a, b, c)`).
#[derive(Clone, Encodable, Decodable, Debug)]
pub struct MethodCall {