Change lib to &[Shared<Module>] and remove dummy lifetimes.

This commit is contained in:
Stephen Chung
2022-11-07 16:18:59 +08:00
parent 4455d95abc
commit 0c79471fd3
16 changed files with 93 additions and 94 deletions

View File

@@ -3,7 +3,6 @@
use crate::func::{CallableFunction, StraightHashMap};
use crate::types::BloomFilterU64;
use crate::{ImmutableString, StaticVec};
use std::marker::PhantomData;
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
@@ -45,21 +44,18 @@ impl FnResolutionCache {
/// The following caches are contained inside this type:
/// * A stack of [function resolution caches][FnResolutionCache]
#[derive(Debug, Clone)]
pub struct Caches<'a> {
pub struct Caches {
/// Stack of [function resolution caches][FnResolutionCache].
stack: StaticVec<FnResolutionCache>,
/// Take care of the lifetime parameter.
dummy: PhantomData<&'a ()>,
}
impl Caches<'_> {
impl Caches {
/// Create an empty [`Caches`].
#[inline(always)]
#[must_use]
pub const fn new() -> Self {
Self {
stack: StaticVec::new_const(),
dummy: PhantomData,
}
}
/// Get the number of function resolution cache(s) in the stack.