luaur-common 0.1.3

Foundational data structures and flags for the luaur Luau-in-Rust toolchain.
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::macros::luau_assert::LUAU_ASSERT;
use crate::records::small_vector::SmallVector;

impl<T, const N: usize> SmallVector<T, N> {
    pub fn back_mut(&mut self) -> &mut T {
        LUAU_ASSERT!(self.size() > 0);
        let index = (self.size() as usize) - 1;
        &mut self.as_mut_slice()[index]
    }
}