git.delta.rocks / jrsonnet / refs/commits / eea91c38b18b

difftreelog

source

crates/jrsonnet-evaluator/src/gc.rs723 Bsourcehistory
1/// Macros to help deal with Gc2use jrsonnet_gcmodule::Trace;3use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet};45pub trait WithCapacityExt {6	fn new() -> Self;7	fn with_capacity(capacity: usize) -> Self;8}9impl<V> WithCapacityExt for FxHashSet<V> {10	fn with_capacity(capacity: usize) -> Self {11		Self::with_capacity_and_hasher(capacity, FxBuildHasher::default())12	}1314	fn new() -> Self {15		Self::with_hasher(FxBuildHasher::default())16	}17}18impl<K, V> WithCapacityExt for FxHashMap<K, V> {19	fn with_capacity(capacity: usize) -> Self {20		Self::with_capacity_and_hasher(capacity, FxBuildHasher::default())21	}2223	fn new() -> Self {24		Self::with_hasher(FxBuildHasher::default())25	}26}2728pub fn assert_trace<T: Trace>(_v: &T) {}