Crates.io | stringlit |
lib.rs | stringlit |
version | 2.1.0 |
source | src |
created_at | 2019-04-24 08:44:47.336188 |
updated_at | 2023-07-04 08:19:47.995967 |
description | A macro to convert from str to String |
homepage | https://github.com/hardliner66/stringlit |
repository | https://github.com/hardliner66/stringlit |
max_upload_size | |
id | 129838 |
size | 3,601 |
A macro to convert from str to String.
// import the macros
//
use stringlit::{s, string};
fn print_string(s: String) {
println!("{}", s);
}
fn main() {
// now you can use
print_string(s!("test"));
// or
print_string(string!("test"));
// instead of
print_string("test".to_owned());
}