diff --git a/src/database/document_key.rs b/src/database/document_key.rs index f56bda1dd..cfcb34ad6 100644 --- a/src/database/document_key.rs +++ b/src/database/document_key.rs @@ -2,7 +2,7 @@ use std::io::{Cursor, Read, Write}; use std::mem::size_of; use std::fmt; -use byteorder::{NativeEndian, WriteBytesExt, ReadBytesExt}; +use byteorder::{BigEndian, WriteBytesExt, ReadBytesExt}; use crate::database::schema::SchemaAttr; use crate::DocumentId; @@ -19,7 +19,7 @@ impl DocumentKey { let mut wtr = Cursor::new(&mut buffer[..]); wtr.write_all(b"doc-").unwrap(); - wtr.write_u64::(id.0).unwrap(); + wtr.write_u64::(id.0).unwrap(); DocumentKey(buffer) } @@ -43,7 +43,7 @@ impl DocumentKey { } pub fn document_id(&self) -> DocumentId { - let id = (&self.0[4..]).read_u64::().unwrap(); + let id = (&self.0[4..]).read_u64::().unwrap(); DocumentId(id) } } @@ -73,7 +73,7 @@ impl DocumentKeyAttr { let mut wtr = Cursor::new(&mut buffer[..]); wtr.write_all(&raw_key).unwrap(); wtr.write_all(b"-").unwrap(); - wtr.write_u16::(attr.0).unwrap(); + wtr.write_u16::(attr.0).unwrap(); DocumentKeyAttr(buffer) } @@ -97,13 +97,13 @@ impl DocumentKeyAttr { } pub fn document_id(&self) -> DocumentId { - let id = (&self.0[4..]).read_u64::().unwrap(); + let id = (&self.0[4..]).read_u64::().unwrap(); DocumentId(id) } pub fn attribute(&self) -> SchemaAttr { let offset = 4 + size_of::() + 1; - let value = (&self.0[offset..]).read_u16::().unwrap(); + let value = (&self.0[offset..]).read_u16::().unwrap(); SchemaAttr::new(value) }