diff --git a/src/compiler/comptypes.rs b/src/compiler/comptypes.rs index 90b6444c4..1a0263660 100644 --- a/src/compiler/comptypes.rs +++ b/src/compiler/comptypes.rs @@ -474,7 +474,10 @@ pub trait HasCompilerOptsDelegation { fn compiler_opts(&self) -> Rc; /// Call a function that updates this object's CompilerOpts and use the /// update our own object with the result. Return the new wrapper. - fn update_compiler_opts) -> Rc>(&self, f: F) -> Rc; + fn update_compiler_opts) -> Rc>( + &self, + f: F, + ) -> Rc; // Defaults. fn override_filename(&self) -> String { @@ -544,7 +547,10 @@ pub trait HasCompilerOptsDelegation { fn override_set_start_env(&self, start_env: Option>) -> Rc { self.update_compiler_opts(|o| o.set_start_env(start_env)) } - fn override_set_prim_map(&self, new_map: Rc, Rc>>) -> Rc { + fn override_set_prim_map( + &self, + new_map: Rc, Rc>>, + ) -> Rc { self.update_compiler_opts(|o| o.set_prim_map(new_map)) } fn override_read_new_file( @@ -561,7 +567,8 @@ pub trait HasCompilerOptsDelegation { sexp: Rc, symbol_table: &mut HashMap, ) -> Result { - self.compiler_opts().compile_program(allocator, runner, sexp, symbol_table) + self.compiler_opts() + .compile_program(allocator, runner, sexp, symbol_table) } } diff --git a/src/tests/classic/stage_2.rs b/src/tests/classic/stage_2.rs index d72e98da6..3f2698469 100644 --- a/src/tests/classic/stage_2.rs +++ b/src/tests/classic/stage_2.rs @@ -16,8 +16,8 @@ use crate::classic::clvm_tools::stages::stage_2::helpers::{brun, evaluate, quote use crate::classic::clvm_tools::stages::stage_2::operators::run_program_for_search_paths; use crate::classic::clvm_tools::stages::stage_2::reader::{process_embed_file, read_file}; -use crate::compiler::comptypes::{CompileErr, CompilerOpts, HasCompilerOptsDelegation}; use crate::compiler::compiler::DefaultCompilerOpts; +use crate::compiler::comptypes::{CompileErr, CompilerOpts, HasCompilerOptsDelegation}; use crate::compiler::sexp::decode_string; use crate::compiler::srcloc::Srcloc; @@ -307,7 +307,10 @@ struct TestCompilerOptsPresentsOwnFiles { impl TestCompilerOptsPresentsOwnFiles { fn new(filename: String, files: HashMap) -> Self { - TestCompilerOptsPresentsOwnFiles { files: Rc::new(files), opts: Rc::new(DefaultCompilerOpts::new(&filename)) } + TestCompilerOptsPresentsOwnFiles { + files: Rc::new(files), + opts: Rc::new(DefaultCompilerOpts::new(&filename)), + } } } @@ -316,11 +319,14 @@ impl HasCompilerOptsDelegation for TestCompilerOptsPresentsOwnFiles { self.opts.clone() } - fn update_compiler_opts) -> Rc>(&self, f: F) -> Rc { + fn update_compiler_opts) -> Rc>( + &self, + f: F, + ) -> Rc { let new_opts = f(self.opts.clone()); Rc::new(TestCompilerOptsPresentsOwnFiles { opts: new_opts, - .. self.clone() + ..self.clone() }) } diff --git a/src/tests/compiler/fuzz.rs b/src/tests/compiler/fuzz.rs index e9fbd46fe..6016d4871 100644 --- a/src/tests/compiler/fuzz.rs +++ b/src/tests/compiler/fuzz.rs @@ -55,12 +55,17 @@ impl TestModuleCompilerOpts { } impl HasCompilerOptsDelegation for TestModuleCompilerOpts { - fn compiler_opts(&self) -> Rc { self.opts.clone() } - fn update_compiler_opts) -> Rc>(&self, f: F) -> Rc { + fn compiler_opts(&self) -> Rc { + self.opts.clone() + } + fn update_compiler_opts) -> Rc>( + &self, + f: F, + ) -> Rc { let new_opts = f(self.opts.clone()); Rc::new(TestModuleCompilerOpts { opts: new_opts, - .. self.clone() + ..self.clone() }) } }