From 9b3a2afb7a30f1d577b60e7489a857af010e9c5f Mon Sep 17 00:00:00 2001 From: "Brian R. Murphy" <132495859+brmataptos@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:42:06 -0800 Subject: [PATCH] fix lint --- third_party/move/move-model/src/ast.rs | 9 +++---- third_party/move/move-model/src/sourcifier.rs | 27 +++++++++---------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/third_party/move/move-model/src/ast.rs b/third_party/move/move-model/src/ast.rs index 9123e5c76d733..cd4a22f2c0060 100644 --- a/third_party/move/move-model/src/ast.rs +++ b/third_party/move/move-model/src/ast.rs @@ -1127,12 +1127,9 @@ impl ExpData { pub fn called_funs(&self) -> BTreeSet> { let mut called = BTreeSet::new(); let mut visitor = |e: &ExpData| { - match e { - ExpData::Call(_, Operation::MoveFunction(mid, fid), _) => { - called.insert(mid.qualified(*fid)); - }, - _ => {}, - } + if let ExpData::Call(_, Operation::MoveFunction(mid, fid), _) = e { + called.insert(mid.qualified(*fid)); + }; true // keep going }; self.visit_post_order(&mut visitor); diff --git a/third_party/move/move-model/src/sourcifier.rs b/third_party/move/move-model/src/sourcifier.rs index 60b2b02fad021..85c9dde1ac676 100644 --- a/third_party/move/move-model/src/sourcifier.rs +++ b/third_party/move/move-model/src/sourcifier.rs @@ -538,21 +538,18 @@ impl<'a> ExpSourcifier<'a> { Value(id, v) => { let ty = self.env().get_node_type(exp.node_id()); self.parent.print_value(v, Some(&ty)); - match v { - ast::Value::Function(..) => { - let type_inst = self.env().get_node_instantiation(*id); - if !type_inst.is_empty() { - emit!( - self.wr(), - "<{}>", - type_inst - .iter() - .map(|ty| ty.display(&self.type_display_context)) - .join(", ") - ); - } - }, - _ => {}, + if let ast::Value::Function(..) = v { + let type_inst = self.env().get_node_instantiation(*id); + if !type_inst.is_empty() { + emit!( + self.wr(), + "<{}>", + type_inst + .iter() + .map(|ty| ty.display(&self.type_display_context)) + .join(", ") + ); + } } }, LocalVar(_, name) => {