Skip to content

Commit 4826944

Browse files
Dr-EmannFreaky
authored andcommitted
No need to reference count static variables
1 parent 7996d56 commit 4826944

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/persistence.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use directories::ProjectDirs;
22
use hashfilter::HashFilter;
33
use lazy_static::lazy_static;
4-
use std::sync::{Arc, RwLock};
4+
use std::sync::RwLock;
55

66
use crate::config::ConfigFile;
77

88
lazy_static! {
9-
static ref PATHDB: Arc<RwLock<HashFilter>> = Arc::new(RwLock::new(HashFilter::default()));
10-
static ref CONFIG: Arc<RwLock<ConfigFile>> = Arc::new(RwLock::new(ConfigFile::default()));
9+
static ref PATHDB: RwLock<HashFilter> = RwLock::new(HashFilter::default());
10+
static ref CONFIG: RwLock<ConfigFile> = RwLock::new(ConfigFile::default());
1111
}
1212

1313
pub fn init() {
@@ -20,10 +20,10 @@ pub fn init() {
2020
}
2121
}
2222

23-
pub fn config() -> Arc<RwLock<ConfigFile>> {
24-
CONFIG.clone()
23+
pub fn config() -> &'static RwLock<ConfigFile> {
24+
&CONFIG
2525
}
2626

27-
pub fn pathdb() -> Arc<RwLock<HashFilter>> {
28-
PATHDB.clone()
27+
pub fn pathdb() -> &'static RwLock<HashFilter> {
28+
&PATHDB
2929
}

0 commit comments

Comments
 (0)