remove lazy_static dependency

This commit is contained in:
Bilal Elmoussaoui 2020-12-10 01:56:11 +01:00
parent 9de3fd861c
commit ee69e5865a
4 changed files with 4 additions and 13 deletions

1
Cargo.lock generated
View file

@ -280,7 +280,6 @@ dependencies = [
"gtk4", "gtk4",
"hex", "hex",
"image", "image",
"lazy_static",
"libhandy4", "libhandy4",
"log", "log",
"once_cell", "once_cell",

View file

@ -12,7 +12,6 @@ futures = "0.3"
gettext-rs = {version = "0.5", features = ["gettext-system"]} gettext-rs = {version = "0.5", features = ["gettext-system"]}
gtk-macros = "0.2" gtk-macros = "0.2"
image = "0.23" image = "0.23"
lazy_static = "1.4"
log = "0.4" log = "0.4"
pretty_env_logger = "0.4" pretty_env_logger = "0.4"
quick-xml = "0.20" quick-xml = "0.20"

View file

@ -1,15 +1,9 @@
#[macro_use] #[macro_use]
extern crate log; extern crate log;
#[macro_use] #[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate diesel_migrations;
#[macro_use]
extern crate diesel; extern crate diesel;
#[macro_use] #[macro_use]
extern crate glib; extern crate diesel_migrations;
#[macro_use]
extern crate gtk_macros;
use gettextrs::*; use gettextrs::*;
mod application; mod application;

View file

@ -4,13 +4,12 @@ use diesel::r2d2;
use diesel::r2d2::ConnectionManager; use diesel::r2d2::ConnectionManager;
use std::path::PathBuf; use std::path::PathBuf;
use std::{fs, fs::File}; use std::{fs, fs::File};
use once_cell::sync::Lazy;
type Pool = r2d2::Pool<ConnectionManager<SqliteConnection>>; type Pool = r2d2::Pool<ConnectionManager<SqliteConnection>>;
lazy_static! { static DB_PATH: Lazy<PathBuf> = Lazy::new(|| glib::get_user_data_dir().join("authenticator"));
static ref DB_PATH: PathBuf = glib::get_user_data_dir().join("authenticator"); static POOL: Lazy<Pool> = Lazy::new(|| init_pool().expect("Failed to create a pool"));
static ref POOL: Pool = init_pool().expect("Failed to create a pool");
}
embed_migrations!("migrations/"); embed_migrations!("migrations/");