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

Rework how protocol functions are called #210

Merged
merged 1 commit into from
Dec 9, 2020
Merged

Rework how protocol functions are called #210

merged 1 commit into from
Dec 9, 2020

Conversation

udoprog
Copy link
Collaborator

@udoprog udoprog commented Dec 9, 2020

This allows them to be called more flexibly, and for the string_debug
case avoids the need to allocate a local string buffer internally when
debug formatting.

Unfortunately this means the fmt::Debug impl suffers a bit in that it
duplicates string_debug. There's just no way to punt a
fmt::Formatter into a String, and since it has a lifetime it can't
be called through rune interfaces.

This allows them to be called more flexibly, and for the `string_debug`
case avoids the need to allocate a local string buffer internally when
debug formatting.

Unfortunately this means the `fmt::Debug` impl suffers a bit in that it
duplicates `string_debug`. There's just no way to punt a
`fmt::Formatter` into a `String`, and since it has a lifetime it can't
be called through rune interfaces.
@udoprog udoprog added the enhancement New feature or request label Dec 9, 2020
@udoprog udoprog merged commit 94f56a7 into main Dec 9, 2020
@udoprog udoprog deleted the rework-protocols branch December 9, 2020 15:14
@udoprog udoprog added the changelog Issue has been added to the changelog label Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Issue has been added to the changelog enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant