Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Jul 15, 2024
1 parent 1f2361f commit 96989a9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
6 changes: 2 additions & 4 deletions src/compiler/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<u8>> = deps_of_constant
.difference(function_set)
.cloned()
.collect();
let only_constant_deps: HashSet<Vec<u8>> =
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;
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ fn form_module_program_common_body(
mut program: CompileForm,
exports: &[Export],
) -> Result<CompileForm, CompileErr> {
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.
Expand Down Expand Up @@ -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()));
}
Expand Down
10 changes: 5 additions & 5 deletions src/compiler/preprocessor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions src/tests/compiler/cldb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit 96989a9

Please sign in to comment.