edit the two lasts TODO comments

This commit is contained in:
Tamo 2021-09-08 18:12:10 +02:00
parent b15c77ebc4
commit bad8ea47d5
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69
2 changed files with 3 additions and 2 deletions

View File

@ -33,7 +33,8 @@ pub fn extract_geo_points<R: io::Read>(
let bytes: [u8; 16] = concat_arrays![lat.to_ne_bytes(), lng.to_ne_bytes()];
writer.insert(docid_bytes, bytes)?;
} else {
let primary_key = obkv.get(primary_key_id).unwrap(); // TODO: TAMO: is this valid?
// All document must have a primary key so we can unwrap safely here
let primary_key = obkv.get(primary_key_id).unwrap();
let primary_key =
serde_json::from_slice(primary_key).map_err(InternalError::SerdeJson)?;
Err(UserError::InvalidGeoField { document_id: primary_key, object: point })?

View File

@ -229,7 +229,7 @@ impl<'t, 'u, 'i, 'a> IndexDocuments<'t, 'u, 'i, 'a> {
) = crossbeam_channel::unbounded();
// get the primary key field id
let primary_key_id = fields_ids_map.id(&primary_key).unwrap(); // TODO: TAMO: is this unwrap 100% valid?
let primary_key_id = fields_ids_map.id(&primary_key).unwrap();
// get searchable fields for word databases
let searchable_fields =