src: address a bunch of clippy::pedantic lints
This commit is contained in:
@@ -276,7 +276,7 @@ impl<A: Annotation> Default for Expr<A> {
|
||||
}
|
||||
|
||||
impl<A: Annotation> Expr<A> {
|
||||
pub fn anno(self, annotation: A) -> Anno<Expr<A>, A> {
|
||||
pub const fn anno(self, annotation: A) -> Anno<Expr<A>, A> {
|
||||
Anno(self, annotation)
|
||||
}
|
||||
|
||||
@@ -292,15 +292,15 @@ impl<A: Annotation> Expr<A> {
|
||||
Self::Op(Op::Do, exprs)
|
||||
}
|
||||
|
||||
pub fn is_place(&self) -> bool {
|
||||
pub const fn is_place(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
Self::Id(_) | Self::Op(Op::Index, _) | Self::Op(Op::Dot, _) | Self::Op(Op::Deref, _)
|
||||
Self::Id(_) | Self::Op(Op::Index | Op::Dot | Op::Deref, _)
|
||||
)
|
||||
}
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub fn as_slice(&self) -> Option<(Op, &[Anno<Expr<A>, A>])> {
|
||||
pub const fn as_slice(&self) -> Option<(Op, &[Anno<Expr<A>, A>])> {
|
||||
match self {
|
||||
Expr::Op(op, args) => Some((*op, args.as_slice())),
|
||||
_ => None,
|
||||
|
||||
Reference in New Issue
Block a user