the-string-macro 1.0.1

The missing `string!` macro to construct `String` value from string literal.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 0 items with examples
  • Size
  • Source code size: 1.47 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 989.42 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • stdrc

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"),
    }
];