Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  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. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement