2025-02-21 16:07:35 +01:00
|
|
|
use std :: ffi :: * ;
|
|
|
|
use std :: fmt :: * ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
macro_rules ! concat_os_str { (
|
|
|
|
$ base : expr ,
|
|
|
|
$ ( $ suffix : expr ) , +
|
|
|
|
) => { {
|
|
|
|
let mut base = std :: ffi :: OsString :: from ( $ base ) ;
|
|
|
|
$ ( base . push ( $ suffix ) ; ) +
|
|
|
|
base
|
|
|
|
} } }
|
|
|
|
|
2024-11-29 21:06:43 +01:00
|
|
|
pub fn leak < 'l , Type > ( inner : Type ) -> & 'l Type {
|
2024-11-20 16:32:37 +01:00
|
|
|
Box :: leak ( Box :: new (inner) )
|
|
|
|
}
|
2025-02-18 17:40:32 +01:00
|
|
|
|
|
|
|
pub fn leak_mut < 'l , Type > ( inner : Type ) -> & 'l mut Type {
|
|
|
|
Box :: leak ( Box :: new (inner) )
|
|
|
|
}
|
2025-02-18 18:31:05 +01:00
|
|
|
|
|
|
|
macro_rules ! pinned_async { (
|
|
|
|
$ ( $ async_expression : expr ) ; +
|
|
|
|
) => {
|
|
|
|
Box :: pin ( async {
|
|
|
|
$ ( $ async_expression ) ; +
|
|
|
|
} )
|
|
|
|
} }
|
|
|
|
|
2025-02-21 16:07:35 +01:00
|
|
|
pub fn to_os_string ( value : impl Display + Sized ) -> OsString {
|
|
|
|
OsString :: from ( ToString :: to_string ( & value ) )
|
|
|
|
}
|
|
|
|
|
2025-02-18 18:31:05 +01:00
|
|
|
|
|
|
|
|
2025-02-21 16:07:35 +01:00
|
|
|
pub (crate) use concat_os_str ;
|
2025-02-18 18:31:05 +01:00
|
|
|
pub (crate) use pinned_async ;
|