From 6508cc90783c458bb1212c37a216f31b4defece1 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Tue, 28 Feb 2023 16:33:39 -0800 Subject: [PATCH] Format. --- src/backend/mod.rs | 3 +-- src/ir/func.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/backend/mod.rs b/src/backend/mod.rs index 3900d41..8a649a5 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -586,8 +586,7 @@ pub fn compile(module: &Module<'_>) -> anyhow::Result> { for (func, func_decl) in module.funcs.entries().skip(num_func_imports) { match func_decl { FuncDecl::Import(_, _) => anyhow::bail!("Import comes after func with body: {}", func), - FuncDecl::Lazy(sig, _, _) - | FuncDecl::Body(sig, _, _) => { + FuncDecl::Lazy(sig, _, _) | FuncDecl::Body(sig, _, _) => { funcs.function(sig.index() as u32); } FuncDecl::None => panic!("FuncDecl::None at compilation time"), diff --git a/src/ir/func.rs b/src/ir/func.rs index 7c937ed..06f6cb6 100644 --- a/src/ir/func.rs +++ b/src/ir/func.rs @@ -75,18 +75,18 @@ impl<'a> FuncDecl<'a> { pub fn name(&self) -> &str { match self { - FuncDecl::Body(_, name, _) - | FuncDecl::Lazy(_, name, _) - | FuncDecl::Import(_, name) => &name[..], + FuncDecl::Body(_, name, _) | FuncDecl::Lazy(_, name, _) | FuncDecl::Import(_, name) => { + &name[..] + } FuncDecl::None => panic!("No name for FuncDecl::None"), } } pub fn set_name(&mut self, new_name: &str) { match self { - FuncDecl::Body(_, name, _) - | FuncDecl::Lazy(_, name, _) - | FuncDecl::Import(_, name) => *name = new_name.to_owned(), + FuncDecl::Body(_, name, _) | FuncDecl::Lazy(_, name, _) | FuncDecl::Import(_, name) => { + *name = new_name.to_owned() + } FuncDecl::None => panic!("No name for FuncDecl::None"), } }