Clean up more clippy.

This commit is contained in:
Stephen Chung
2022-07-27 18:04:59 +08:00
parent 39dee556c4
commit 2f948a784c
47 changed files with 412 additions and 377 deletions

View File

@@ -554,19 +554,19 @@ impl AST {
lib
};
let mut _ast = if !other.source.is_empty() {
let mut _ast = if other.source.is_empty() {
Self::new(
merged,
#[cfg(not(feature = "no_function"))]
lib,
)
} else {
Self::new_with_source(
merged,
#[cfg(not(feature = "no_function"))]
lib,
other.source.clone(),
)
} else {
Self::new(
merged,
#[cfg(not(feature = "no_function"))]
lib,
)
};
#[cfg(not(feature = "no_module"))]
@@ -977,6 +977,7 @@ impl Eq for ASTNode<'_> {}
impl ASTNode<'_> {
/// Get the [`Position`] of this [`ASTNode`].
#[must_use]
pub fn position(&self) -> Position {
match self {
ASTNode::Stmt(stmt) => stmt.position(),