1 unstable release
new 0.1.0 | Apr 21, 2025 |
---|
#896 in Procedural macros
8KB
easy_macro
Most usefull rust macros
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
About The Project
I have created a library for combine all rust macro what i use in one place. I tryed make this macro max readable.
Getting Started
Just add new dependencie in your Cargo.toml file.
- Cargo.toml
[dependencies] easy_macro = "0.1"
Usage
use easy_macro::EasyBuilder;
#[derive(EasyBuilder)]
struct MyStruct {
field1: i32,
field2: String,
}
impl Default for MyStruct {
fn default() -> Self {
Self {
field1: 0,
field2: String::from("123123")
}
}
}
fn main() {
let builded_struct = MyStruct::default().set_field1(42).set_field2(String::from("pewpew"));
}
For more examples, please refer to the Documentation
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact
Bogdan Lipovtsev - megafreelancer2012@gmail.com
Project Link: https://github.com/zaqxsw-dev/easy_macro
Dependencies
~1.5MB
~38K SLoC