From df7627137bd10b20584c8bab3386bd46dfb01d5f Mon Sep 17 00:00:00 2001 From: Mackenzie Hauck Date: Sun, 22 Jul 2018 16:32:01 -0600 Subject: [PATCH] update to tantivy 0.6.1 * change from create() to create_in_dir() * fix issue #12 "Field name must match the pattern" --- src/commands/new.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/new.rs b/src/commands/new.rs index 14cb23c..3f44a00 100644 --- a/src/commands/new.rs +++ b/src/commands/new.rs @@ -24,7 +24,7 @@ fn prompt_input Result<(), String>>(prompt_text: &str, predicate: io::stdout().flush().unwrap(); let mut buffer = String::new(); io::stdin().read_line(&mut buffer).ok().expect("Failed to read line"); - let answer = buffer.trim_right_matches("\n").to_string(); + let answer = buffer.trim_right().to_string(); match predicate(&answer) { Ok(()) => { return answer; @@ -145,7 +145,7 @@ fn run_new(directory: PathBuf) -> tantivy::Result<()> { let schema = schema_builder.build(); let schema_json = format!("{}", serde_json::to_string_pretty(&schema).unwrap()); println!("\n{}\n", Style::new().fg(Green).paint(schema_json)); - Index::create(&directory, schema)?; + Index::create_in_dir(&directory, schema)?; Ok(()) }