feat: Introduce documents addition using the update system

This commit is contained in:
Clément Renault 2019-08-21 17:12:52 +02:00 committed by Clément Renault
parent 5a9e25c315
commit f83d6df4ef
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
7 changed files with 186 additions and 192 deletions

View file

@ -6,7 +6,6 @@ use std::io::{self, BufRead, BufReader};
use std::path::{Path, PathBuf};
use std::time::Instant;
use std::error::Error;
use std::borrow::Cow;
use std::fs::File;
use diskus::Walk;
@ -44,9 +43,8 @@ pub struct Opt {
}
#[derive(Serialize, Deserialize)]
struct Document<'a> (
#[serde(borrow)]
HashMap<Cow<'a, str>, Cow<'a, str>>
struct Document (
HashMap<String, String>
);
#[derive(Debug, Clone, Serialize, Deserialize)]
@ -138,7 +136,7 @@ fn index(
}
};
update.update_document(&document)?;
update.update_document(document);
print!("\rindexing document {}", i);
i += 1;