#low-overhead #string #manner #macro #apps #alloc #together

string_concat

A useful macro for concatenating strings in low overhead manner

2 releases

0.0.1 May 19, 2020
0.0.0 May 19, 2020

#12 in #manner

Download history 330/week @ 2024-01-02 380/week @ 2024-01-09 905/week @ 2024-01-16 356/week @ 2024-01-23 528/week @ 2024-01-30 397/week @ 2024-02-06 292/week @ 2024-02-13 533/week @ 2024-02-20 701/week @ 2024-02-27 533/week @ 2024-03-05 404/week @ 2024-03-12 653/week @ 2024-03-19 536/week @ 2024-03-26 410/week @ 2024-04-02 370/week @ 2024-04-09 369/week @ 2024-04-16

1,764 downloads per month
Used in 9 crates (4 directly)

MIT/Apache

6KB
52 lines

string_concat!

A useful macro for putting together strings in a low overhead manner for no_std + alloc apps.

let name = "Richard";
let msg:String = string_concat!("Hello ",name,"!");

saves you from typing

let name = "Richard";
let msg:String = {
  let temp_string = String::new();
  temp_string.push_str("Hello");
  temp_string.push_str(name);
  temp_string.push_str("!");
  temp_string
}

Contributors

  • @richardanaya
  • @RustyYato

No runtime deps