Skip to content

Commit ecf92b3

Browse files
authored
Clarifications to README.md
1 parent a79f1d8 commit ecf92b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Utilities for working with impl traits in Rust.
77
`trait_variant` generates a specialized version of a base trait that uses `async fn` and/or `-> impl Trait`. For example, if you want a `Send`able version of your trait, you'd write:
88

99
```rust
10-
#[trait_variant::make(SendIntFactory: Send)]
11-
trait IntFactory {
10+
#[trait_variant::make(IntFactory: Send)]
11+
trait LocalIntFactory {
1212
async fn make(&self) -> i32;
1313
// ..or..
1414
fn stream(&self) -> impl Iterator<Item = i32>;
1515
fn call(&self) -> u32;
1616
}
1717
```
1818

19-
Which creates a new `SendIntFactory: IntFactory + Send` trait and additionally bounds `SendIntFactory::make(): Send` and `SendIntFactory::stream(): Send`. Ordinary methods are not affected.
19+
Which creates a new `IntFactory: Send` trait and additionally bounds `IntFactory::make(): Send` and `IntFactory::stream(): Send`. Ordinary methods are not affected.
2020

2121
Implementers of the trait can choose to implement the variant instead of the original trait. The macro creates a blanket impl which ensures that any type which implements the variant also implements the original trait.
2222

0 commit comments

Comments
 (0)