#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

#13 in #manner

Download history 728/week @ 2024-07-21 486/week @ 2024-07-28 546/week @ 2024-08-04 700/week @ 2024-08-11 386/week @ 2024-08-18 964/week @ 2024-08-25 653/week @ 2024-09-01 647/week @ 2024-09-08 558/week @ 2024-09-15 1069/week @ 2024-09-22 1227/week @ 2024-09-29 1125/week @ 2024-10-06 415/week @ 2024-10-13 1130/week @ 2024-10-20 745/week @ 2024-10-27 961/week @ 2024-11-03

3,279 downloads per month
Used in 14 crates (5 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