Skip to content

Change the argument type of project method back to self: Pin<&mut Self> #89

Closed
@taiki-e

Description

@taiki-e

The signature of the generated project method changes as follows.

before:

fn project(self: &mut Pin<&mut Self>) -> ProjectedType;

after:

fn project(self: Pin<&mut Self>) -> ProjectedType;

The advantage of the current approach is that you can call the project method multiple times without .as_mut().

However, there are drawbacks such as requiring a different method to avoid lifetime issues (#65), and not being able to call the method without importing trait (#21 (comment)).

Also, by reverting this, the code generated by the macro will be simpler.

Related: #47 (comment)

PR: #90

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions