@@ -1,6 +1,6 @@
|
||||
use core::slice::SlicePattern;
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::{Path};
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
@@ -22,22 +22,10 @@ impl std::ops::Deref for Db {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Db {
|
||||
fn default() -> Self {
|
||||
Self(Arc::new(DefaultDb::default()))
|
||||
}
|
||||
}
|
||||
|
||||
struct DefaultDb {
|
||||
db: sled::Db,
|
||||
}
|
||||
|
||||
impl Default for DefaultDb {
|
||||
fn default() -> Self {
|
||||
Self::new(&PathBuf::from("churn-server.sled"))
|
||||
}
|
||||
}
|
||||
|
||||
impl DefaultDb {
|
||||
pub fn new(path: &Path) -> Self {
|
||||
Self {
|
||||
|
Reference in New Issue
Block a user