diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-02 18:36:06 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-02 18:36:06 -0600 |
| commit | 8cdfa445d6629ffef4cb84967ff7017654045bc2 (patch) | |
| tree | 22f0b0907c024c78d26a731e2e1f5219407d8102 /vendor/please/README.md | |
| parent | 4351c74c7c5f97156bc94d3a8549b9940ac80e3f (diff) | |
chore: add vendor directory
Diffstat (limited to 'vendor/please/README.md')
| -rw-r--r-- | vendor/please/README.md | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/vendor/please/README.md b/vendor/please/README.md new file mode 100644 index 00000000..6645b640 --- /dev/null +++ b/vendor/please/README.md @@ -0,0 +1,57 @@ +# please + +A simple Rust library providing convenient builder pattern utilities. + +## Overview + +`please` offers two main functions for creating and initializing objects: + +- `build()` - Creates a new instance using the type's `Default` implementation +- `build_with()` - Creates a new instance and applies a custom initializer function + +## Usage + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +please = "0.1.0" +``` + +### Examples + +Basic usage with `build()`: + +```rust +use please::build; + +#[derive(Default)] +struct Person { + name: String, + age: i32, +} + +let person = build::<Person>(); +// Creates Person { name: "", age: 0 } +``` + +Custom initialization with `build_with()`: + +```rust +use please::build_with; + +let person = build_with(|p: &mut Person| { + p.name = String::from("Alice"); + p.age = 30; +}); +// Creates Person { name: "Alice", age: 30 } +``` + +## Requirements + +- Rust 2024 edition +- Types must implement `Default` trait + +## License + +MIT
\ No newline at end of file |
