#slice #macro-string #concatenation

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

#1282 in Rust patterns

Download history 3891/week @ 2025-07-21 4217/week @ 2025-07-28 4534/week @ 2025-08-04 4049/week @ 2025-08-11 3818/week @ 2025-08-18 4259/week @ 2025-08-25 3846/week @ 2025-09-01 4281/week @ 2025-09-08 4302/week @ 2025-09-15 4080/week @ 2025-09-22 4012/week @ 2025-09-29 4265/week @ 2025-10-06 3897/week @ 2025-10-13 5361/week @ 2025-10-20 4648/week @ 2025-10-27 4473/week @ 2025-11-03

18,801 downloads per month
Used in 111 crates (18 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