You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using BytesMut::unsplit in a project and would like to raise an error when the bytes cannot be unsplitted, instead of silently copying. An Err(_) would let me know I messed up somewhere, so I can go fix the problem.
Reading the source code, I came across try_unsplit, which seems to do exactly what I need, but is private. Have you considered making it public? Or is there a suitable workaround for people like me, who want to guarantee that no data is ever copied from one BytesMut to the other?
In case it's relevant, below is the code for try_unsplit that I think could be made public:
I'm using
BytesMut::unsplit
in a project and would like to raise an error when the bytes cannot be unsplitted, instead of silently copying. AnErr(_)
would let me know I messed up somewhere, so I can go fix the problem.Reading the source code, I came across
try_unsplit
, which seems to do exactly what I need, but is private. Have you considered making it public? Or is there a suitable workaround for people like me, who want to guarantee that no data is ever copied from oneBytesMut
to the other?In case it's relevant, below is the code for
try_unsplit
that I think could be made public:bytes/src/bytes_mut.rs
Lines 908 to 926 in cb7f844
The text was updated successfully, but these errors were encountered: