feat: Introduce typed keys constructors

This commit is contained in:
Clément Renault 2018-11-22 18:28:11 +01:00
parent 66dac923bf
commit a43a772e9a
No known key found for this signature in database
GPG key ID: 0151CDAB43460DAE
6 changed files with 145 additions and 43 deletions

View file

@ -23,7 +23,8 @@ impl DocIds {
Ok(DocIds { doc_ids })
}
pub fn from_bytes(vec: Vec<u8>) -> io::Result<Self> {
pub fn from_bytes(vec: Vec<u8>) -> Result<Self, Box<Error>> {
// FIXME check if modulo DocumentId
let len = vec.len();
let doc_ids = Data::Shared {
vec: Arc::new(vec),