the-string-macro

Crates.iothe-string-macro
lib.rsthe-string-macro
version1.0.1
sourcesrc
created_at2024-11-29 07:35:14.896491
updated_at2024-11-29 07:36:22.636462
descriptionThe missing `string!` macro to construct `String` value from string literal.
homepage
repository
max_upload_size
id1465267
size1,778
Richard Chien (stdrc)

documentation

README

the-string-macro

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...

Usage

the-string-macro = "1"
use the_string_macro::string;

let s = string!("foo");
let props = vec![
    Foo {
        key: string!("key1"),
        value: string!("value1"),
    }
];
Commit count: 0

cargo fmt