From 8639e08ac5acdd77c4de3b90caa416e7c570e898 Mon Sep 17 00:00:00 2001 From: Reinout Meliesie Date: Tue, 18 Feb 2025 17:40:32 +0100 Subject: [PATCH] Add leak_mut convenience function --- src/utility.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utility.rs b/src/utility.rs index e6ad3d5..8dcca3e 100644 --- a/src/utility.rs +++ b/src/utility.rs @@ -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) ) +}