Implement more clippy suggestions
This commit is contained in:
@@ -14,7 +14,7 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct Point {
|
pub struct Point {
|
||||||
pub x: f64,
|
pub x: f64,
|
||||||
pub y: f64,
|
pub y: f64,
|
||||||
@@ -37,6 +37,12 @@ impl Point {
|
|||||||
|
|
||||||
impl Eq for Point {}
|
impl Eq for Point {}
|
||||||
|
|
||||||
|
impl PartialEq for Point {
|
||||||
|
fn eq(&self, other: &Self) -> bool {
|
||||||
|
self.x == other.x && self.y == other.y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Hash for Point {
|
impl Hash for Point {
|
||||||
fn hash<H: Hasher>(&self, hasher: &mut H) {
|
fn hash<H: Hasher>(&self, hasher: &mut H) {
|
||||||
self.x.to_bits().hash(hasher);
|
self.x.to_bits().hash(hasher);
|
||||||
|
|||||||
+3
-1
@@ -100,7 +100,9 @@ pub fn free(pathfinder: Pathfinder) {
|
|||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[wasm_bindgen(js_name=findPath)]
|
#[wasm_bindgen(js_name=findPath)]
|
||||||
pub fn find_path(pathfinder: &mut Pathfinder, from: JsPoint, to: JsPoint) -> Option<Array> {
|
pub fn find_path(pathfinder: &mut Pathfinder, from: JsPoint, to: JsPoint) -> Option<Array> {
|
||||||
pathfinder.find_path(from.into(), to.into()).map(|first_node| first_node.iter_path().map(JsValue::from).collect())
|
pathfinder
|
||||||
|
.find_path(from.into(), to.into())
|
||||||
|
.map(|first_node| first_node.iter_path().map(JsValue::from).collect())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ use std::collections::hash_set;
|
|||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub struct PtrIndexedHashSet<T>(FxHashSet<PtrIndexedRc<T>>);
|
pub struct PtrIndexedHashSet<T>(FxHashSet<PtrIndexedRc<T>>);
|
||||||
|
|
||||||
impl<T> PtrIndexedHashSet<T> {
|
impl<T> PtrIndexedHashSet<T> {
|
||||||
|
|||||||
Reference in New Issue
Block a user