Skip to content

Commit 7585051

Browse files
committed
Switch to using AnyArrays for queries
1 parent cd776ce commit 7585051

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ impl Query {
345345
panic!("Argument cannot be empty")
346346
}
347347
// A data element will look like:
348-
// `+<bytes_in_next_line>\n<data>`
349-
self.data.push(b'+');
348+
// `<bytes_in_next_line>\n<data>`
350349
let bytes_in_next_line = arg.len().to_string().into_bytes();
351350
self.data.extend(bytes_in_next_line);
352351
// add the LF char
@@ -398,7 +397,7 @@ impl Query {
398397
stream.write_all(b"*1\n").await?;
399398
// Add the dataframe
400399
let number_of_items_in_datagroup = self.__len().to_string().into_bytes();
401-
stream.write_all(&[b'_']).await?;
400+
stream.write_all(&[b'~']).await?;
402401
stream.write_all(&number_of_items_in_datagroup).await?;
403402
stream.write_all(&[b'\n']).await?;
404403
stream.write_all(self.get_holding_buffer()).await?;
@@ -416,7 +415,7 @@ impl Query {
416415
stream.write_all(b"*1\n")?;
417416
// Add the dataframe
418417
let number_of_items_in_datagroup = self.__len().to_string().into_bytes();
419-
stream.write_all(&[b'_'])?;
418+
stream.write_all(&[b'~'])?;
420419
stream.write_all(&number_of_items_in_datagroup)?;
421420
stream.write_all(&[b'\n'])?;
422421
stream.write_all(self.get_holding_buffer())?;
@@ -433,7 +432,7 @@ impl Query {
433432
/// return the raw query that would be written to the stream, serialized using the Skyhash serialization protocol
434433
pub fn into_raw_query(self) -> Vec<u8> {
435434
let mut v = Vec::with_capacity(self.data.len());
436-
v.extend(b"*1\n_");
435+
v.extend(b"*1\n~");
437436
v.extend(self.__len().to_string().into_bytes());
438437
v.extend(b"\n");
439438
v.extend(self.get_holding_buffer());

0 commit comments

Comments
 (0)