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

Remove Trait constraint for Port::new() #188

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

josephlr
Copy link
Contributor

@josephlr josephlr commented Sep 29, 2020

Right now we use Traits with const fn in two different ways:

  1. PortRead/PortWrite/PortReadWrite, which can never have const fn implementaitons
  2. PageSize which always has a const fn implementation (as it's just two associated consts)

The use of (1) can be eliminated by only constraining the Port::read method instead of the Port::new method. This is similar to what the standard library does for Once::new.

Signed-off-by: Joe Richey [email protected]

@josephlr josephlr requested a review from phil-opp September 29, 2020 11:04
Copy link
Member

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

2 participants