Skip to content

Commit 9deed11

Browse files
authored
Merge shortening of name to trait_variant::make
This is PR #8.
2 parents a4ced57 + 956123d commit 9deed11

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
Utilities for working with impl traits in Rust.
44

5-
## `make_variant`
5+
## `trait_variant`
66

7-
`make_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:
7+
`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_variant(SendIntFactory: Send)]
10+
#[trait_variant::make(SendIntFactory: Send)]
1111
trait IntFactory {
1212
async fn make(&self) -> i32;
1313
// ..or..
@@ -22,7 +22,7 @@ Implementers of the trait can choose to implement the variant instead of the ori
2222

2323
## `trait_transformer`
2424

25-
`trait_transformer` does the same thing as `make_variant`, but using experimental nightly-only syntax that depends on the `return_type_notation` feature. It may be used to experiment with new kinds of trait transformations in the future.
25+
`trait_transformer` does the same thing as `make`, but using experimental nightly-only syntax that depends on the `return_type_notation` feature. It may be used to experiment with new kinds of trait transformations in the future.
2626

2727
#### License and usage notes
2828

trait-variant/examples/variant.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
use std::future::Future;
1010

11-
use trait_variant::make_variant;
12-
13-
#[make_variant(IntFactory: Send)]
11+
#[trait_variant::make(IntFactory: Send)]
1412
pub trait LocalIntFactory {
1513
const NAME: &'static str;
1614

trait-variant/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ pub fn trait_transformer(
2020
}
2121

2222
#[proc_macro_attribute]
23-
pub fn make_variant(
23+
pub fn make(
2424
attr: proc_macro::TokenStream,
2525
item: proc_macro::TokenStream,
2626
) -> proc_macro::TokenStream {
27-
variant::make_variant(attr, item)
27+
variant::make(attr, item)
2828
}

trait-variant/src/variant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Parse for MakeVariant {
4949
}
5050
}
5151

52-
pub fn make_variant(
52+
pub fn make(
5353
attr: proc_macro::TokenStream,
5454
item: proc_macro::TokenStream,
5555
) -> proc_macro::TokenStream {

0 commit comments

Comments
 (0)