feat: rec attrset
This commit is contained in:
@@ -20,20 +20,10 @@ use nixjit_value::Const as PubConst;
|
||||
///
|
||||
/// Using a newtype wrapper like this prevents accidentally mixing up different kinds of indices.
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct ExprId(usize);
|
||||
|
||||
impl ExprId {
|
||||
/// Creates a clone of the `ExprId`.
|
||||
///
|
||||
/// # Safety
|
||||
/// This is a shallow copy of the index. The caller must ensure that the lifetime
|
||||
/// and validity of the expression being referenced are handled correctly.
|
||||
#[inline(always)]
|
||||
pub unsafe fn clone(&self) -> Self {
|
||||
Self(self.0)
|
||||
}
|
||||
|
||||
/// Returns the raw `usize` index.
|
||||
///
|
||||
/// # Safety
|
||||
|
||||
Reference in New Issue
Block a user