summaryrefslogtreecommitdiff
path: root/src/syntax/ast.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-30 09:48:30 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-30 09:48:30 +0100
commit68c6160a14be4e77b98cd704d9e641a03aefa332 (patch)
tree3eb0d02bf16e62cf43b7e5426126934b4ce7fbf2 /src/syntax/ast.rs
parenta12bc3a797c1a29ef223c9e8be6c52cc4e748a02 (diff)
Recursion with max depth
Diffstat (limited to 'src/syntax/ast.rs')
-rw-r--r--src/syntax/ast.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index d2b19ee3..6483f7cc 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -1277,7 +1277,7 @@ impl Closure {
///
/// This only exists if you use the function syntax sugar: `let f(x) = y`.
pub fn name(&self) -> Option<Ident> {
- self.0.cast_first_child()
+ self.0.children().next()?.cast()
}
/// The parameter bindings.