Apply lints and cleanup to Rust code

This commit is contained in:
Keavon Chambers
2023-01-29 03:01:57 -08:00
parent 5388b59e97
commit d990110f63
27 changed files with 122 additions and 119 deletions

View File

@@ -32,7 +32,7 @@ where
type Output = Any<'n>;
fn eval(self, input: Any<'n>) -> Self::Output {
let node = core::any::type_name::<N>();
let input: Box<I> = dyn_any::downcast(input).expect(format!("DynAnyNode Input in:\n{node}").as_str());
let input: Box<I> = dyn_any::downcast(input).unwrap_or_else(|_| panic!("DynAnyNode Input in:\n{node}"));
Box::new(self.0.eval(*input))
}
}
@@ -43,7 +43,7 @@ where
type Output = Any<'n>;
fn eval(self, input: Any<'n>) -> Self::Output {
let node = core::any::type_name::<N>();
let input: Box<I> = dyn_any::downcast(input).expect(format!("DynAnyNode Input in:\n{node}").as_str());
let input: Box<I> = dyn_any::downcast(input).unwrap_or_else(|_| panic!("DynAnyNode Input in:\n{node}"));
Box::new((&self.0).eval_ref(*input))
}
}