Satisfy more clippy.
This commit is contained in:
@@ -1012,7 +1012,20 @@ impl PartialEq for ASTNode<'_> {
|
||||
impl Eq for ASTNode<'_> {}
|
||||
|
||||
impl ASTNode<'_> {
|
||||
/// Is this [`ASTNode`] a [`Stmt`]?
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub const fn is_stmt(&self) -> bool {
|
||||
matches!(self, Self::Stmt(..))
|
||||
}
|
||||
/// Is this [`ASTNode`] an [`Expr`]?
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub const fn is_expr(&self) -> bool {
|
||||
matches!(self, Self::Expr(..))
|
||||
}
|
||||
/// Get the [`Position`] of this [`ASTNode`].
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn position(&self) -> Position {
|
||||
match self {
|
||||
|
@@ -6,7 +6,7 @@ use std::prelude::v1::*;
|
||||
|
||||
/// A type representing the access mode of a function.
|
||||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[cfg_attr(feature = "metadata", derive(serde::Serialize))]
|
||||
#[cfg_attr(feature = "metadata", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[cfg_attr(feature = "metadata", serde(rename_all = "camelCase"))]
|
||||
#[non_exhaustive]
|
||||
pub enum FnAccess {
|
||||
|
@@ -926,10 +926,7 @@ impl Stmt {
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub const fn is_control_flow_break(&self) -> bool {
|
||||
match self {
|
||||
Self::Return(..) | Self::BreakLoop(..) => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, Self::Return(..) | Self::BreakLoop(..))
|
||||
}
|
||||
/// Recursively walk this statement.
|
||||
/// Return `false` from the callback to terminate the walk.
|
||||
|
Reference in New Issue
Block a user