Rename Update/Type SchemaUpdate into Schema

This commit is contained in:
Clément Renault 2019-10-11 13:49:17 +02:00
parent 97de72de83
commit da6ab2753e
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
2 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ use meilidb_schema::Schema;
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub enum Update { pub enum Update {
SchemaUpdate(Schema), Schema(Schema),
DocumentsAddition(Vec<rmpv::Value>), DocumentsAddition(Vec<rmpv::Value>),
DocumentsDeletion(Vec<DocumentId>), DocumentsDeletion(Vec<DocumentId>),
SynonymsAddition(BTreeMap<String, Vec<String>>), SynonymsAddition(BTreeMap<String, Vec<String>>),
@ -31,7 +31,7 @@ pub enum Update {
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub enum UpdateType { pub enum UpdateType {
SchemaUpdate { schema: Schema }, Schema { schema: Schema },
DocumentsAddition { number: usize }, DocumentsAddition { number: usize },
DocumentsDeletion { number: usize }, DocumentsDeletion { number: usize },
SynonymsAddition { number: usize }, SynonymsAddition { number: usize },
@ -104,10 +104,10 @@ pub fn update_task(writer: &mut rkv::Writer, index: store::Index) -> MResult<Opt
debug!("Processing update number {}", update_id); debug!("Processing update number {}", update_id);
let (update_type, result, duration) = match update { let (update_type, result, duration) = match update {
Update::SchemaUpdate(schema) => { Update::Schema(schema) => {
let start = Instant::now(); let start = Instant::now();
let update_type = UpdateType::SchemaUpdate { schema: schema.clone() }; let update_type = UpdateType::Schema { schema: schema.clone() };
let result = apply_schema_update(writer, index.main, &schema); let result = apply_schema_update(writer, index.main, &schema);
(update_type, result, start.elapsed()) (update_type, result, start.elapsed())

View File

@ -24,7 +24,7 @@ pub fn push_schema_update(
{ {
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?; let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
let update = Update::SchemaUpdate(schema); let update = Update::Schema(schema);
updates_store.put_update(writer, last_update_id, &update)?; updates_store.put_update(writer, last_update_id, &update)?;
Ok(last_update_id) Ok(last_update_id)