string_to_static_str

Function string_to_static_str 

Source
pub fn string_to_static_str(s: String) -> &'static str
Expand description

This function converts a String to a &’static str

§Arguments

  • s: String - The textual string to be converted.

§Example

extern crate test_data_generation;

use test_data_generation::shared;

fn main() {
    let my_string = String::from("Hello World");
	let static_str =  shared::string_to_static_str(my_string);
}