Implement clippy suggestions

This commit is contained in:
Manuel Vögele
2022-01-31 23:29:01 +01:00
parent 8817775201
commit cd61aa948e
3 changed files with 6 additions and 10 deletions
+1 -5
View File
@@ -100,11 +100,7 @@ pub fn free(pathfinder: Pathfinder) {
#[allow(dead_code)]
#[wasm_bindgen(js_name=findPath)]
pub fn find_path(pathfinder: &mut Pathfinder, from: JsPoint, to: JsPoint) -> Option<Array> {
if let Some(first_node) = pathfinder.find_path(from.into(), to.into()) {
Some(first_node.iter_path().map(JsValue::from).collect())
} else {
None
}
pathfinder.find_path(from.into(), to.into()).map(|first_node| first_node.iter_path().map(JsValue::from).collect())
}
#[allow(dead_code)]