From 1428e6e6eb1d930e31d5fb9dd1f03ce597545cc1 Mon Sep 17 00:00:00 2001 From: John-John Tedro Date: Wed, 14 Aug 2024 07:23:26 +0200 Subject: [PATCH] index: more cleanups --- crates/rune/src/indexing/index.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/rune/src/indexing/index.rs b/crates/rune/src/indexing/index.rs index 0fe67b3ea..5b2107573 100644 --- a/crates/rune/src/indexing/index.rs +++ b/crates/rune/src/indexing/index.rs @@ -1247,11 +1247,8 @@ fn expr_field_access( ) -> compile::Result<()> { expr(idx, &mut ast.expr)?; - match &mut ast.expr_field { - ast::ExprField::Path(p) => { - path(idx, p)?; - } - ast::ExprField::LitNumber(..) => {} + if let ast::ExprField::Path(p) = &mut ast.expr_field { + path(idx, p)?; } Ok(()) @@ -1292,12 +1289,9 @@ fn expr_call(idx: &mut Indexer<'_, '_>, ast: &mut ast::ExprCall) -> compile::Res #[instrument_ast(span = ast)] fn expr_object(idx: &mut Indexer<'_, '_>, ast: &mut ast::ExprObject) -> compile::Result<()> { - match &mut ast.ident { - ast::ObjectIdent::Named(p) => { - // Not a variable use: Name of the object. - path(idx, p)?; - } - ast::ObjectIdent::Anonymous(..) => (), + if let ast::ObjectIdent::Named(p) = &mut ast.ident { + // Not a variable use: Name of the object. + path(idx, p)?; } for (assign, _) in &mut ast.assignments {