| Crates.io | smacro |
| lib.rs | smacro |
| version | 0.1.0 |
| created_at | 2025-06-23 14:41:19.335898+00 |
| updated_at | 2025-06-23 14:41:19.335898+00 |
| description | A collection of convenient Rust macros to reduce boilerplate |
| homepage | https://github.com/saverioscagnoli/smacro |
| repository | https://github.com/saverioscagnoli/smacro |
| max_upload_size | |
| id | 1723002 |
| size | 17,291 |
A collection of convenient Rust macros to reduce boilerplate and improve ergonomics.
By default, only macros with no_std support are enabled.
To enable more, just add the corresponding features.
s!A versatile macro for creating String instances with minimal syntax.
use smacro::s;
// Empty string
let empty = s!();
// Convert anything with ToString
let hello = s!("Hello, world!");
let number = s!(42);
// Format strings
let name = "Alice";
let greeting = s!("Hello, {}!", name);
set! - Requires set featureCreate HashSet instances with initial values.
use smacro::set;
// Empty set
let empty = set!();
// Set with values
let numbers = set!(1, 2, 3, 4);
let fruits = set!("apple", "banana", "orange");
map! - Requires map featureCreate HashMap instances with key-value pairs.
use smacro::map;
// Empty map
let empty = map![];
// Map with initial data
let colors = map![
"red" => "#FF0000",
"green" => "#00FF00",
"blue" => "#0000FF"
];
MIT, see LICENSE