From 96989a9fe8556febe7e3ebd9cf6cef0f4a994efc Mon Sep 17 00:00:00 2001 From: arty Date: Mon, 15 Jul 2024 02:42:47 -0700 Subject: [PATCH] fmt --- src/compiler/codegen.rs | 6 ++---- src/compiler/compiler.rs | 8 ++++---- src/compiler/preprocessor/mod.rs | 10 +++++----- src/tests/compiler/cldb.rs | 10 +++++----- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/compiler/codegen.rs b/src/compiler/codegen.rs index 72e0b1a1..18ba075d 100644 --- a/src/compiler/codegen.rs +++ b/src/compiler/codegen.rs @@ -1564,10 +1564,8 @@ fn find_easiest_constant( for (i, h) in constants_in_set.iter().enumerate() { let mut deps_of_constant = HashSet::new(); depgraph.get_full_depends_on(&mut deps_of_constant, h.name()); - let only_constant_deps: HashSet> = deps_of_constant - .difference(function_set) - .cloned() - .collect(); + let only_constant_deps: HashSet> = + deps_of_constant.difference(function_set).cloned().collect(); let how_many_deps = only_constant_deps.len(); if i == 0 || how_many_deps < best_dep_set { chosen_idx = i; diff --git a/src/compiler/compiler.rs b/src/compiler/compiler.rs index 2c3151b0..10060c6a 100644 --- a/src/compiler/compiler.rs +++ b/src/compiler/compiler.rs @@ -312,7 +312,9 @@ fn form_module_program_common_body( mut program: CompileForm, exports: &[Export], ) -> Result { - program.helpers.retain(|h| !standalone_constants.contains(h.name())); + program + .helpers + .retain(|h| !standalone_constants.contains(h.name())); // The body should contain anything that is in the exports but not standalone // constants. @@ -353,9 +355,7 @@ fn form_module_program_common_body( for (target_name, capture) in exports.iter().filter_map(|e| { if let Export::Function(name, as_name) = e { - let target_name = as_name - .clone() - .unwrap_or_else(|| name.clone()); + let target_name = as_name.clone().unwrap_or_else(|| name.clone()); if !standalone_constants.contains(name) { return Some((target_name, name.clone())); } diff --git a/src/compiler/preprocessor/mod.rs b/src/compiler/preprocessor/mod.rs index 707ce160..73e6bda6 100644 --- a/src/compiler/preprocessor/mod.rs +++ b/src/compiler/preprocessor/mod.rs @@ -689,11 +689,11 @@ impl Preprocessor { .read_new_file(self.opts.filename(), fname.to_string())?; let content = if let IncludeProcessType::Bin = &kind { - if self.opts.dialect().int_fix { - Rc::new(SExp::QuotedString(loc.clone(), b'x', content)) - } else { - Rc::new(SExp::Atom(loc.clone(), content)) - } + if self.opts.dialect().int_fix { + Rc::new(SExp::QuotedString(loc.clone(), b'x', content)) + } else { + Rc::new(SExp::Atom(loc.clone(), content)) + } } else if let IncludeProcessType::Hex = &kind { hex_to_modern_sexp( &mut allocator, diff --git a/src/tests/compiler/cldb.rs b/src/tests/compiler/cldb.rs index af286994..02c584a5 100644 --- a/src/tests/compiler/cldb.rs +++ b/src/tests/compiler/cldb.rs @@ -207,11 +207,11 @@ fn compile_and_run_program_with_tree( cldb_hierarchy(CldbHierarchyArgs { runner, - Rc::new(prim_map), - Some(input_file.to_owned()), - program_lines, - Rc::new(use_symbol_table), - Rc::new(program.to_sexp()), + prim_map: Rc::new(prim_map), + input_file_name: Some(input_file.to_owned()), + lines: program_lines, + symbol_table: Rc::new(use_symbol_table), + prog: Rc::new(program.to_sexp()), args, flags, })