| Crates.io | unwrap-sugar |
| lib.rs | unwrap-sugar |
| version | 0.1.1 |
| created_at | 2022-07-24 14:24:27.359923+00 |
| updated_at | 2022-07-24 14:33:28.299771+00 |
| description | Just a simple sugar for unwrapable expressions |
| homepage | https://github.com/jedsek/unwrap-sugar |
| repository | https://github.com/jedsek/unwrap-sugar |
| max_upload_size | |
| id | 632021 |
| size | 1,243,746 |
This just unwraps all expression in the macro simply.
The expressions must be unwrapable.
unwrap_sugar! {
// Immutable
a = Some('a');
// Mutable
mut b = Some('b');
// Immutable with Type
c:char = {
Some('C').map(|x| x.to_ascii_lowercase())
};
};
assert_eq!(a, 'a');
assert_eq!(b, 'b');
assert_eq!(c, 'c');