vyre-libs 0.6.1

vyre Category A library ecosystem - pure-IR compositions over vyre-ops hardware primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Checked allocation helpers shared by NFA compiler submodules.

use super::NfaCompileError;

pub(super) fn reserve_vec<T>(
    vec: &mut Vec<T>,
    requested: usize,
    field: &'static str,
) -> Result<(), NfaCompileError> {
    vyre_foundation::allocation::try_reserve_vec_to_capacity(vec, requested).map_err(|source| {
        NfaCompileError::StorageReserveFailed {
            field,
            requested,
            message: source.to_string(),
        }
    })
}