Skip to content

Provide a Display API for string_view via .display()#515

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
test_873138034
Open

Provide a Display API for string_view via .display()#515
copybara-service[bot] wants to merge 1 commit intomainfrom
test_873138034

Conversation

@copybara-service
Copy link

@copybara-service copybara-service bot commented Feb 21, 2026

Provide a Display API for string_view via .display()

As discussed in the API Review, we'd like to start by not implementing Display directly, but rather providing it through a proxy method .display(). This provides us with an easy avenue to implement Display directly in the future if we decide we want to (whereas going the other way would be much more difficult).

This CL also extracts the shared Display implementation for string and string_view to a LossyUtf8Display struct.

@google-cla
Copy link

google-cla bot commented Feb 21, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

As discussed in the API Review, we'd like to start by not implementing Display directly, but rather providing it through a proxy method `.display()`. This provides us with an easy avenue to implement Display directly in the future if we decide we want to (whereas going the other way would be much more difficult).

This CL also extracts the shared Display implementation for `string` and `string_view` to a `LossyUtf8Display` struct.

PiperOrigin-RevId: 873138034
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.

0 participants