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

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

#7 in #concatenating

Download history 611/week @ 2024-11-17 1438/week @ 2024-11-24 1010/week @ 2024-12-01 1135/week @ 2024-12-08 745/week @ 2024-12-15 435/week @ 2024-12-22 703/week @ 2024-12-29 869/week @ 2025-01-05 545/week @ 2025-01-12 850/week @ 2025-01-19 965/week @ 2025-01-26 690/week @ 2025-02-02 952/week @ 2025-02-09 1028/week @ 2025-02-16 799/week @ 2025-02-23 700/week @ 2025-03-02

3,564 downloads per month
Used in 15 crates (6 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