1
2
3
4
5
6
7
8
9
10
11
12
13





/* 
    converting the String into an static str by leaking the memory of the 
    String to create a longer lifetime allocation for an slice of the String 
*/
pub fn string_to_static_str(s: String) -> &'static str { 
    Box::leak(s.into_boxed_str()) 
}