Crates.io | the-string-macro |
lib.rs | the-string-macro |
version | 1.0.1 |
source | src |
created_at | 2024-11-29 07:35:14.896491 |
updated_at | 2024-11-29 07:36:22.636462 |
description | The missing `string!` macro to construct `String` value from string literal. |
homepage | |
repository | |
max_upload_size | |
id | 1465267 |
size | 1,778 |
We all have been tired arguing about which of the following is the best practice:
"foo".to_owned()
"foo".to_string()
String::from("foo")
format!("foo")
It's time to finish this...
the-string-macro = "1"
use the_string_macro::string;
let s = string!("foo");
let props = vec![
Foo {
key: string!("key1"),
value: string!("value1"),
}
];