From f65153ad6454317213680e9a9a908ec78d5645a7 Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 28 Sep 2021 18:35:54 +0200 Subject: [PATCH] stop casting integer docids to string --- milli/src/update/index_documents/mod.rs | 6 +++--- milli/src/update/index_documents/transform.rs | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index 498a2a85d..e61fbd6b4 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -536,7 +536,7 @@ mod tests { // Check that this document is equal to the last one sent. let mut doc_iter = doc.iter(); - assert_eq!(doc_iter.next(), Some((0, &br#""1""#[..]))); + assert_eq!(doc_iter.next(), Some((0, &b"1"[..]))); assert_eq!(doc_iter.next(), Some((1, &br#""benoit""#[..]))); assert_eq!(doc_iter.next(), None); drop(rtxn); @@ -562,9 +562,9 @@ mod tests { // Check that this document is equal to the last one sent. let mut doc_iter = doc.iter(); - assert_eq!(doc_iter.next(), Some((0, &br#""1""#[..]))); + assert_eq!(doc_iter.next(), Some((0, &b"1"[..]))); assert_eq!(doc_iter.next(), Some((1, &br#""benoit""#[..]))); - assert_eq!(doc_iter.next(), Some((2, &br#"25"#[..]))); + assert_eq!(doc_iter.next(), Some((2, &b"25"[..]))); assert_eq!(doc_iter.next(), None); drop(rtxn); } diff --git a/milli/src/update/index_documents/transform.rs b/milli/src/update/index_documents/transform.rs index fc5eb2c84..8d656e50c 100644 --- a/milli/src/update/index_documents/transform.rs +++ b/milli/src/update/index_documents/transform.rs @@ -171,7 +171,6 @@ impl Transform<'_, '_> { } }; serde_json::to_writer(&mut external_id_buffer, &value).unwrap(); - *bytes = &external_id_buffer; Cow::Owned(value) } None => {