Upgrade to the Rust 2024 edition (#2367)

* Update to rust 2024 edition

* Fixes

* Clean up imports

* Cargo fmt again

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2025-03-13 01:29:12 +01:00
committed by GitHub
parent 927d7dd9b2
commit beb1c6ae64
253 changed files with 980 additions and 1371 deletions

View File

@@ -1,14 +1,12 @@
use parking_lot::RawRwLock;
use std::{
any::Any,
borrow::Borrow,
cell::RefCell,
collections::{hash_map::DefaultHasher, HashMap},
hash::{Hash, Hasher},
iter,
iter::Sum,
marker::PhantomData,
};
use std::any::Any;
use std::borrow::Borrow;
use std::cell::RefCell;
use std::collections::hash_map::DefaultHasher;
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use std::iter::{self, Sum};
use std::marker::PhantomData;
use storage_map::{StorageMap, StorageMapGuard};
/// Caches the output of a given Node and acts as a proxy
@@ -21,8 +19,16 @@ impl<'n: 'c, 'c, NODE: Node + 'c> Node for SmartCacheNode<'n, 'c, NODE>
where
for<'a> NODE::Input<'a>: Hash,
{
type Input<'a> = NODE::Input<'a> where Self: 'a, 'c : 'a;
type Output<'a> = StorageMapGuard<'a, RawRwLock, CacheNode<'n, 'c, NODE>> where Self: 'a, 'c: 'a;
type Input<'a>
= NODE::Input<'a>
where
Self: 'a,
'c: 'a;
type Output<'a>
= StorageMapGuard<'a, RawRwLock, CacheNode<'n, 'c, NODE>>
where
Self: 'a,
'c: 'a;
fn eval<'a, I: Borrow<Self::Input<'a>>>(&'a self, input: I) -> Self::Output<'a> {
let mut hasher = DefaultHasher::new();
input.borrow().hash(&mut hasher);