#proc-macro #create-instance #macro #proc

macro macron-str

Creates a new instance of String

2 releases

0.1.1 May 25, 2025
0.1.0 Apr 6, 2025

#18 in #create-instance

Download history 1/week @ 2025-06-08 10/week @ 2025-07-06 13/week @ 2025-07-13 36/week @ 2025-07-20 18/week @ 2025-07-27 13/week @ 2025-08-03 11/week @ 2025-08-10 21/week @ 2025-08-17 25/week @ 2025-08-24 38/week @ 2025-08-31 25/week @ 2025-09-07 27/week @ 2025-09-14 21/week @ 2025-09-21

112 downloads per month
Used in 4 crates (via macron)

MIT license

5KB

githubcrates-iodocs-rs

String Macro

Introduction:

Creates a new instance of String.

P.s.: More useful macros you can find here.

Examples:

// simple string:
let s = str!("Hello, World!");

assert_eq!(s, "Hello, World!");

// from integer:
let s = str!(10);

assert_eq!(s, "10");

// from refference:
let r = 10.2;
let s = str!(r);

assert_eq!(s, "10.2");

// string formatting with arguments:
let s = str!("Hello, {}!", "World");

assert_eq!(s, "Hello, World!");

// string formatting with named arguments:
let name = "World";
let s = str!("Hello, {name}!");

assert_eq!(s, "Hello, World!");

Licensing:

Distributed under the MIT license.

Feedback:

You can contact me via GitHub or send a message to my Telegram @fuderis.

This library is constantly evolving, and I welcome your suggestions and feedback.

Dependencies

~160–570KB
~14K SLoC