Skip to main content

http_type/box_leak/
fn.rs

1/// Creates a new boxed value and leaks it, returning a static mutable reference.
2///
3/// # Arguments
4///
5/// - `T` - The data type to be boxed and leaked.
6///
7/// # Returns
8///
9/// - `&'static mut T` - A static mutable reference to the leaked value.
10#[inline(always)]
11pub fn box_leak_new<T>(data: T) -> &'static mut T {
12    Box::leak(Box::new(data))
13}