Add leak_mut convenience function

This commit is contained in:
Reinout Meliesie 2025-02-18 17:40:32 +01:00
parent 6021fb5901
commit 8639e08ac5
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6

View file

@ -1,3 +1,7 @@
pub fn leak < 'l , Type > ( inner : Type ) -> & 'l Type {
Box :: leak ( Box :: new (inner) )
}
pub fn leak_mut < 'l , Type > ( inner : Type ) -> & 'l mut Type {
Box :: leak ( Box :: new (inner) )
}