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 get that it's supposed to be a 1 <-> 1 with std::fs::write but it copies whatever you give it and it doesn't even tell you about it until you look at the source code.
A better interface might be something like AsRef<[u8]> + Send + 'static so that you can pass owned data like Vec<u8>, Arc<[u8]>, bytes::Bytes...
However this is a breaking change as &[u8] could no longer be sent.
So either a new API for this or comment clearly that this will clone the data.
The text was updated successfully, but these errors were encountered:
I get that it's supposed to be a 1 <-> 1 with
std::fs::write
but it copies whatever you give it and it doesn't even tell you about it until you look at the source code.A better interface might be something like
AsRef<[u8]> + Send + 'static
so that you can pass owned data likeVec<u8>
,Arc<[u8]>
,bytes::Bytes
...However this is a breaking change as
&[u8]
could no longer be sent.So either a new API for this or comment clearly that this will clone the data.
The text was updated successfully, but these errors were encountered: