diff --git a/schala-lang/src/lib.rs b/schala-lang/src/lib.rs index e6a5c2d..0c580fb 100644 --- a/schala-lang/src/lib.rs +++ b/schala-lang/src/lib.rs @@ -91,13 +91,17 @@ fn symbol_table(handle: &mut Schala, input: parsing::AST, comp: Option<&mut Unfi fn typechecking(handle: &mut Schala, input: parsing::AST, comp: Option<&mut UnfinishedComputation>) -> Result { match handle.type_context.type_check_ast(&input) { Ok(ty) => { - comp.map(|c| c.add_artifact(TraceArtifact::new("type_table", format!("{}", handle.type_context.debug_types())))); - comp.map(|c| c.add_artifact(TraceArtifact::new("type_check", format!("{:?}", ty)))); + comp.map(|c| { + c.add_artifact(TraceArtifact::new("type_table", format!("{}", handle.type_context.debug_types()))); + c.add_artifact(TraceArtifact::new("type_check", format!("{:?}", ty))); + }); Ok(input) }, Err(msg) => { - comp.map(|comp| comp.add_artifact(TraceArtifact::new("type_table", format!("{}", handle.type_context.debug_types())))); - comp.map(|comp| comp.add_artifact(TraceArtifact::new("type_check", format!("Type error: {:?}", msg)))); + comp.map(|comp| { + comp.add_artifact(TraceArtifact::new("type_table", format!("{}", handle.type_context.debug_types()))); + comp.add_artifact(TraceArtifact::new("type_check", format!("Type error: {:?}", msg))); + }); Ok(input) } }