#slice #string #format-string #concatenation #owned #macro

concat-string

Provides macros for concatenating string slices into owned strings

2 stable releases

Uses old Rust 2015

1.0.1 Jul 1, 2018
1.0.0 Sep 28, 2017

#1043 in Rust patterns

Download history 2900/week @ 2024-07-23 3081/week @ 2024-07-30 2727/week @ 2024-08-06 2761/week @ 2024-08-13 2620/week @ 2024-08-20 2405/week @ 2024-08-27 2605/week @ 2024-09-03 2697/week @ 2024-09-10 2277/week @ 2024-09-17 2611/week @ 2024-09-24 2306/week @ 2024-10-01 2454/week @ 2024-10-08 2700/week @ 2024-10-15 2570/week @ 2024-10-22 2663/week @ 2024-10-29 3093/week @ 2024-11-05

11,503 downloads per month
Used in 87 crates (17 directly)

Apache-2.0 OR MIT

8KB
51 lines

concat-string

Travis CI AppVeyor Crates.io Docs.rs

This crate provides the concat_string! macro for efficiently concatenating string slices into owned strings. concat_string! accepts any number of arguments that implement AsRef<str> and creates a String with the appropriate capacity, without the need for format strings and their associated runtime overhead.

Example

#[macro_use(concat_string)]
extern crate concat_string;

fn main() {
    println!("{}", concat_string!("Hello", String::from(" "), "world"));
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps