Browse Source

update to tantivy 0.6.1

* change from create() to create_in_dir()

* fix issue #12 "Field name must match the pattern"
develop
Mackenzie Hauck 6 years ago
parent
commit
df7627137b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/commands/new.rs

+ 2
- 2
src/commands/new.rs View File

@@ -24,7 +24,7 @@ fn prompt_input<P: Fn(&str) -> Result<(), String>>(prompt_text: &str, predicate:
io::stdout().flush().unwrap(); io::stdout().flush().unwrap();
let mut buffer = String::new(); let mut buffer = String::new();
io::stdin().read_line(&mut buffer).ok().expect("Failed to read line"); 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) { match predicate(&answer) {
Ok(()) => { Ok(()) => {
return answer; return answer;
@@ -145,7 +145,7 @@ fn run_new(directory: PathBuf) -> tantivy::Result<()> {
let schema = schema_builder.build(); let schema = schema_builder.build();
let schema_json = format!("{}", serde_json::to_string_pretty(&schema).unwrap()); let schema_json = format!("{}", serde_json::to_string_pretty(&schema).unwrap());
println!("\n{}\n", Style::new().fg(Green).paint(schema_json)); println!("\n{}\n", Style::new().fg(Green).paint(schema_json));
Index::create(&directory, schema)?;
Index::create_in_dir(&directory, schema)?;
Ok(()) Ok(())
} }



Loading…
Cancel
Save