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

Add an BuilderAppendError type alias. #38

Merged
merged 2 commits into from
Jul 17, 2023
Merged

Add an BuilderAppendError type alias. #38

merged 2 commits into from
Jul 17, 2023

Conversation

partim
Copy link
Member

@partim partim commented Jul 14, 2023

This PR adds a type alias to refer to the AppendError of an octets type’s associated builder. Instead of having to write:

fn build<Octs>() -> Result<Octs, <<Octs as FromBuilder>::Builder as OctetsBuilder>::AppendError> { todo!() }

you can now just write

fn build<Octs>() -> Result<Octs, BuilderAppendError<Octs>> { todo!() }

@partim partim requested a review from DRiKE July 14, 2023 09:15
@partim partim merged commit c6c6be3 into main Jul 17, 2023
24 checks passed
@partim partim deleted the append-error-alias branch July 17, 2023 16:08
partim added a commit that referenced this pull request Oct 18, 2023
Breaking changes

* Change the lifetime of the range for a reference to the lifetime of the
  reference. ([#41] by [@xofyarg])
* Explicitly re-export select items at crate level rather than wildcard
  export everything. ([#39])

New

* Adds a `BuilderAppendError<_>` type alias that simplifies trait bounds
  for complex `FromBuilder` trait bounds. ([#38])

Bug fixes

* Fix `Parser::peek_all` to only return data up until the parser's
  length rather than all data. ([#40])
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