clean up minor warnings
This commit is contained in:
parent
b6962ba9d3
commit
6635a918b5
|
@ -164,11 +164,11 @@ fn fmt_eval(eval_info: &EvalInfo, max_mem: i32, max_cpu: i32) -> String {
|
|||
output
|
||||
.as_ref()
|
||||
.map(|x| format!("{}", x))
|
||||
.unwrap_or("Error.".to_string()),
|
||||
.unwrap_or_else(|| "Error.".to_string()),
|
||||
)
|
||||
}
|
||||
|
||||
fn find_max_execution_units(xs: &Vec<EvalInfo>) -> (i32, i32) {
|
||||
fn find_max_execution_units(xs: &[EvalInfo]) -> (i32, i32) {
|
||||
let (max_mem, max_cpu) = xs.iter().fold(
|
||||
(0, 0),
|
||||
|(max_mem, max_cpu), EvalInfo { spent_budget, .. }| {
|
||||
|
|
|
@ -1540,7 +1540,7 @@ impl<'a> CodeGenerator<'a> {
|
|||
Type::Tuple { .. } => todo!(),
|
||||
};
|
||||
|
||||
if data_type_key.defined_type == "Bool" {
|
||||
if constructor.tipo.is_bool() {
|
||||
arg_stack
|
||||
.push(Term::Constant(UplcConstant::Bool(constr_name == "True")));
|
||||
} else {
|
||||
|
|
|
@ -146,10 +146,8 @@ where
|
|||
self.write_build_outputs(programs, uplc_dump)?;
|
||||
}
|
||||
CodeGenMode::Test(match_tests) => {
|
||||
let tests = self.scripts_gen(&checked_modules, |def| match def {
|
||||
Definition::Test(..) => true,
|
||||
_ => false,
|
||||
})?;
|
||||
let tests =
|
||||
self.scripts_gen(&checked_modules, |def| matches!(def, Definition::Test(..)))?;
|
||||
if !tests.is_empty() {
|
||||
self.event_listener.handle_event(Event::RunningTests);
|
||||
}
|
||||
|
@ -158,10 +156,8 @@ where
|
|||
.handle_event(Event::FinishedTests { tests: results });
|
||||
}
|
||||
CodeGenMode::Eval(func_name) => {
|
||||
let scripts = self.scripts_gen(&checked_modules, |def| match def {
|
||||
Definition::Fn(..) => true,
|
||||
_ => false,
|
||||
})?;
|
||||
let scripts =
|
||||
self.scripts_gen(&checked_modules, |def| matches!(def, Definition::Fn(..)))?;
|
||||
let results = self.eval_scripts(scripts, Some(func_name));
|
||||
self.event_listener
|
||||
.handle_event(Event::EvaluatingFunction { results });
|
||||
|
|
Loading…
Reference in New Issue