Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various cleanup #214

Merged
merged 2 commits into from
May 8, 2020
Merged

Various cleanup #214

merged 2 commits into from
May 8, 2020

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented May 8, 2020

Separated from #202 as unrelated changes.

@taiki-e taiki-e mentioned this pull request May 8, 2020
4 tasks
@taiki-e
Copy link
Owner Author

taiki-e commented May 8, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented May 8, 2020

Build succeeded:

@bors bors bot merged commit 440e8cd into master May 8, 2020
@bors bors bot deleted the cleanup branch May 8, 2020 13:29
bors bot added a commit that referenced this pull request May 18, 2020
202: Allow naming the projected types r=taiki-e a=taiki-e

By passing an argument with the same name as the method to the attribute, you can name the projection type returned from the method:

```rust
#[pin_project(
    Replace,
    project = StructProj,
    project_ref = StructProjRef,
    project_replace = StructProjOwn,
)]
struct Struct<T> {
    #[pin]
    field: T,
}

let mut x = Struct { field: 0 };
let StructProj { field } = Pin::new(&mut x).project();
let StructProjRef { field } = Pin::new(&x).project_ref();
let StructProjOwn { field } = Pin::new(&mut x).project_replace(Struct { field: 1 });
```

cc #43
Closes #124

TODO: 
  * [x] add tests
  * [x] write docs 
  * [x] separate unrelated changes; done in #214
  * [x] msrv (`unrestricted_attribute_tokens` requires 1.34); done in #219 


Co-authored-by: Taiki Endo <te316e89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant