commit | 78d71cac9f91d80e5f64407d8d9be9586d3e052c | [log] [tgz] |
---|---|---|
author | Protobuf Team Bot <protobuf-github-bot@google.com> | Wed Sep 13 11:55:59 2023 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Sep 13 11:59:41 2023 -0700 |
tree | d528d3bc90f9b539360fa1951aeef28855047d9a | |
parent | c92e490ed7e49469d70e9ab317e945ae70f0433f [diff] [blame] |
Fix string setter thunk to use PtrAndLen instead of two args. PiperOrigin-RevId: 565118836
diff --git a/rust/internal.rs b/rust/internal.rs index 5f62b15..1e0f536 100644 --- a/rust/internal.rs +++ b/rust/internal.rs
@@ -97,3 +97,9 @@ } } } + +impl From<&[u8]> for PtrAndLen { + fn from(slice: &[u8]) -> Self { + Self { ptr: slice.as_ptr(), len: slice.len() } + } +}