Fix use-self
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
c3c91e9d80
commit
eae41fc411
18 changed files with 47 additions and 48 deletions
|
@ -11,7 +11,7 @@ pub struct Cork {
|
|||
impl Cork {
|
||||
pub fn new(db: &Arc<dyn KeyValueDatabaseEngine>, flush: bool, sync: bool) -> Self {
|
||||
db.cork().unwrap();
|
||||
Cork {
|
||||
Self {
|
||||
db: db.clone(),
|
||||
flush,
|
||||
sync,
|
||||
|
|
|
@ -157,7 +157,7 @@ pub struct KeyValueDatabase {
|
|||
impl KeyValueDatabase {
|
||||
/// Load an existing database or create a new one.
|
||||
#[allow(clippy::too_many_lines)]
|
||||
pub async fn load_or_create(server: &Arc<Server>) -> Result<KeyValueDatabase> {
|
||||
pub async fn load_or_create(server: &Arc<Server>) -> Result<Self> {
|
||||
let config = &server.config;
|
||||
check_db_setup(config)?;
|
||||
let builder = build(config)?;
|
||||
|
|
|
@ -84,7 +84,7 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
|||
db.latest_sequence_number(),
|
||||
load_time.elapsed()
|
||||
);
|
||||
Ok(Arc::new(Engine {
|
||||
Ok(Self::new(Engine {
|
||||
config: config.clone(),
|
||||
row_cache,
|
||||
col_cache,
|
||||
|
@ -110,7 +110,7 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
|||
|
||||
Ok(Arc::new(RocksDbEngineTree {
|
||||
name,
|
||||
db: Arc::clone(self),
|
||||
db: Self::clone(self),
|
||||
watchers: Watchers::default(),
|
||||
}))
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
|||
|
||||
let writer = Mutex::new(Engine::prepare_conn(&path, cache_size_per_thread)?);
|
||||
|
||||
let arc = Arc::new(Engine {
|
||||
let arc = Self::new(Engine {
|
||||
writer,
|
||||
read_conn_tls: ThreadLocal::new(),
|
||||
read_iterator_conn_tls: ThreadLocal::new(),
|
||||
|
@ -131,7 +131,7 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
|||
)?;
|
||||
|
||||
Ok(Arc::new(SqliteTable {
|
||||
engine: Arc::clone(self),
|
||||
engine: Self::clone(self),
|
||||
name: name.to_owned(),
|
||||
watchers: Watchers::default(),
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue