Crates.io | s-macro |
lib.rs | s-macro |
version | 0.1.0 |
source | src |
created_at | 2023-01-29 12:47:40.173443 |
updated_at | 2023-01-29 12:47:40.173443 |
description | A basic Rust library for conveniently making a String. |
homepage | |
repository | https://github.com/zemja/s-macro |
max_upload_size | |
id | 770888 |
size | 4,239 |
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}"));