Skip to content

Commit

Permalink
Better readme
Browse files Browse the repository at this point in the history
  • Loading branch information
omid committed Nov 9, 2023
1 parent 28790fe commit 6cc921f
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
Some macros to check mutually exclusive conditions of features in Rust.
# Macros to check mutually exclusive of `features` in Rust
___

The macros are `none_or_one_of` and `exactly_one_of`.
It contains `none_or_one_of` and `exactly_one_of` macros.

Both check mutually exclusive of features in Rust,
but `none_or_one_of` allows for no features to be enabled,
while `exactly_one_of` requires exactly one feature to be enabled.

To use `none_or_one_of`, call it with the list of features you want to be mutually exclusive:
## Usage

---

### none_or_one_of

---

Call it with the list of features you want to be mutually exclusive:
```rust
use mutually_exclusive_features::none_or_one_of;
none_or_one_of!("feature1", "feature2", "feature3");
Expand All @@ -24,8 +33,12 @@ compile_error!("The `feature1` and `feature3` features are mutually exclusive an
compile_error!("The `feature2` and `feature3` features are mutually exclusive and cannot be enabled at the same time!");
```

And `exactly_one_of`, is the same, but requires exactly one feature to be enabled:
```
### exactly_one_of

---

It's the same, but requires exactly one feature to be enabled:
```rust
use mutually_exclusive_features::exactly_one_of;
exactly_one_of!("feature1", "feature2", "feature3");
```
Expand Down

0 comments on commit 6cc921f

Please # to comment.