stepancheg / rust-protobuf

Rust implementation of Google protocol buffers
MIT License
2.81k stars 382 forks source link

Allow access to `bytes::Bytes` from `protobuf::Chars` #720

Open SamHDev opened 7 months ago

SamHDev commented 7 months ago

For my current task, I want to slice the underlying bytes of protobuf::Chars from a regex capture group. This seems impossible with the current API.

If this was to be implemented an AsRef<_> would likely be the best way to implement this.

I'mma fork and add this small snippet, lemme know what you think?

- Sam.