Open irevoire opened 5 months ago
When streaming a payload with meilisearch-rust, we have to convert a structure implementing AsyncRead to a structure implementing Stream. This means I have to call poll_read, which have a &[u8] in parameter.
AsyncRead
Stream
poll_read
&[u8]
Currently, to avoid doing anything wrong, I initialize every byte of my buffer to zero here: https://github.com/meilisearch/meilisearch-rust/blob/437649f05264499de8e0e123e310eeee459bace5/src/reqwest.rs#L159
But ideally, this shouldn’t be necessary since we’re never reading these bytes before writing to it.
When streaming a payload with meilisearch-rust, we have to convert a structure implementing
AsyncRead
to a structure implementingStream
. This means I have to callpoll_read
, which have a&[u8]
in parameter.Currently, to avoid doing anything wrong, I initialize every byte of my buffer to zero here: https://github.com/meilisearch/meilisearch-rust/blob/437649f05264499de8e0e123e310eeee459bace5/src/reqwest.rs#L159
But ideally, this shouldn’t be necessary since we’re never reading these bytes before writing to it.