oxc_allocator 0.124.0

A collection of JavaScript tools written in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::Allocator;

/// Accessor for getting the underlying allocator.
pub trait AllocatorAccessor<'a> {
    /// Get the underlying allocator.
    fn allocator(self) -> &'a Allocator;
}

impl<'a> AllocatorAccessor<'a> for &'a Allocator {
    #[inline]
    fn allocator(self) -> &'a Allocator {
        self
    }
}