~taiite/protodump

34315d01ede9523b42fed26375c75b485b5bc108 — Hubert Hirtz 9 days ago b942e48
Avoid pointer to usize conversions
1 files changed, 3 insertions(+), 3 deletions(-)

M src/types.rs
M src/types.rs => src/types.rs +3 -3
@@ 195,12 195,12 @@ where
        use std::collections::hash_map::Entry;

        thread_local! {
            static CACHE: RefCell<HashMap<(usize, usize), bool>> = RefCell::new(HashMap::new());
            static CACHE: RefCell<HashMap<(*const (), *const ()), bool>> = RefCell::new(HashMap::new());
        }

        CACHE.with(|cache| {
            let self_addr = Weak::as_ptr(&self.self_weak) as usize;
            let other_addr = Weak::as_ptr(&other.self_weak) as usize;
            let self_addr = Weak::as_ptr(&self.self_weak) as *const ();
            let other_addr = Weak::as_ptr(&other.self_weak) as *const ();

            match cache.borrow_mut().entry((self_addr, other_addr)) {
                Entry::Vacant(entry) => entry.insert(true),