#string #sugar #macro #proc-macro #easy

macro s-macro

A basic Rust library for conveniently making a String

1 unstable release

0.1.0 Jan 29, 2023

#26 in #easy

Download history 1/week @ 2024-07-29 19/week @ 2024-09-23 9/week @ 2024-09-30

1,254 downloads per month

Unlicense

3KB

s-macro

A basic Rust library for conveniently making a String. Like so:

use s_macro::s;

assert!(s!()                   == String::new());
assert!(s!("hello, world")     == String::from("hello, world"));
assert!(s!(123 + 321)          == format!("{}", 123 + 321));

let world = "world";
assert!(s!("hello, {}", world) == format!("hello, {}", world));
assert!(s!("hello, {world}")   == format!("hello, {world}"));

Dependencies

~1.5MB
~37K SLoC