-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
243: Allow `project_replace` argument to be used without `Replace` r=taiki-e a=taiki-e Currently, both `Replace` and `project_replace = <name>` arguments are required to name the return value of `project_replace()` method. ```rust #[pin_project(Replace, project_replace = EnumProjOwn)] enum Enum<T> { Variant(#[pin] T) } ``` It is not ideal that we need to have both `Replace` and `project_replace = <name>` as `project_replace = <name>` implies that a `project_replace` method is generated. This PR makes `project_replace` argument to use without `Replace` argument. ```diff - #[pin_project(Replace, project_replace = EnumProjOwn)] + #[pin_project(project_replace = EnumProjOwn)] enum Enum<T> { Variant(#[pin] T) } ``` Also, makes `project_replace` argument an alias for `Replace` so that it can be used without a value. ```rust #[pin_project(project_replace)] enum Enum<T> { Variant(#[pin] T) } ``` Related: rust-lang/futures-rs#2176 (comment) hyperium/hyper#2220 (comment) Co-authored-by: Taiki Endo <[email protected]>
- Loading branch information
Showing
31 changed files
with
358 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.