mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
split csv and json document routes
This commit is contained in:
parent
6e8a3fe8de
commit
911630000f
4 changed files with 49 additions and 48 deletions
|
@ -67,8 +67,9 @@ impl<S: Stream<Item = std::result::Result<Bytes, PayloadError>> + Unpin> io::Rea
|
|||
// TODO: optimize buf filling
|
||||
match self.current.take() {
|
||||
Some(mut bytes) => {
|
||||
let copied = bytes.split_to(buf.len());
|
||||
buf.copy_from_slice(&copied);
|
||||
let split_at = bytes.len().min(buf.len());
|
||||
let copied = bytes.split_to(split_at);
|
||||
buf[..split_at].copy_from_slice(&copied);
|
||||
if !bytes.is_empty() {
|
||||
self.current.replace(bytes);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue