reintroduce anyhow

This commit is contained in:
marin postma
2021-06-15 17:39:07 +02:00
parent 439db1aae0
commit 02277ec2cf
36 changed files with 110 additions and 154 deletions

View File

@ -5,8 +5,7 @@ use sha2::Digest;
use crate::index::{Checked, Settings};
use crate::index_controller::{
DumpInfo, IndexController, IndexMetadata, IndexSettings, IndexStats, Stats,
error::Result
error::Result, DumpInfo, IndexController, IndexMetadata, IndexSettings, IndexStats, Stats,
};
use crate::option::Opt;
@ -57,7 +56,7 @@ impl ApiKeys {
}
impl Data {
pub fn new(options: Opt) -> std::result::Result<Data, Box<dyn std::error::Error>> {
pub fn new(options: Opt) -> anyhow::Result<Data> {
let path = options.db_path.clone();
let index_controller = IndexController::new(&path, &options)?;

View File

@ -5,11 +5,7 @@ use crate::index::{SearchQuery, SearchResult};
use crate::index_controller::error::Result;
impl Data {
pub async fn search(
&self,
index: String,
search_query: SearchQuery,
) -> Result<SearchResult> {
pub async fn search(&self, index: String, search_query: SearchQuery) -> Result<SearchResult> {
self.index_controller.search(index, search_query).await
}

View File

@ -3,7 +3,7 @@ use milli::update::{IndexDocumentsMethod, UpdateFormat};
use super::Data;
use crate::index::{Checked, Settings};
use crate::index_controller::{IndexMetadata, IndexSettings, UpdateStatus, error::Result};
use crate::index_controller::{error::Result, IndexMetadata, IndexSettings, UpdateStatus};
impl Data {
pub async fn add_documents(