SHARE
TWEET

Untitled

a guest Mar 26th, 2019 165 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let storage: Result<Box<dyn IMessageStorage>, MessageStoreBuilderError> = match &self.storage {
  2.             None => Err(MessageStoreBuilderError::CouldNotCreateStoreError(
  3.                 "No store type was provided".to_string(),
  4.             )),
  5.             Some(store_type) => match store_type {
  6.                 Storages::Tantivy(path) => match self.read_only {
  7.                     true => Ok(Box::new(tantivy::TantivyStore::new_ro(std::path::PathBuf::from(
  8.                         path,
  9.                     )))),
  10.                     false => Ok(Box::new(tantivy::TantivyStore::new(std::path::PathBuf::from(path)))),
  11.                 },
  12.                 Storages::Rocksdb(path) => rocksdb::RocksDBStore::new(path).map(Box::new),
  13.             },
  14. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top