Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Remove lazy_static, bump to v0.2.0-alpha.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius de Bruijn committed Feb 22, 2020
1 parent 6f8a78e commit 001fcdd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## v0.2.0-alhpa.5
## v0.2.0-alpha.6

- Remove lazy_static in favor of once_cell

## v0.2.0-alpha.5

- Fix possible stack overflows with conditions
- Foreign key constraint errors
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quaint"
version = "0.2.0-alpha.5"
version = "0.2.0-alpha.6"
authors = [
"Julius de Bruijn <[email protected]>",
"Katharina Fey <[email protected]>",
Expand Down Expand Up @@ -49,7 +49,7 @@ serde-support = ["serde", "chrono/serde"]
url = "2.1"
metrics = "0.12"
percent-encoding = "2"
lazy_static = "1.4"
once_cell = "1.3"
num_cpus = "1.12"
rust_decimal = "=1.1.0"
futures = "0.3"
Expand Down
6 changes: 2 additions & 4 deletions src/connector/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,11 @@ impl Queryable for Mysql {
mod tests {
use super::MysqlUrl;
use crate::{connector::Queryable, error::*, single::Quaint};
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use std::env;
use url::Url;

lazy_static! {
static ref CONN_STR: String = env::var("TEST_MYSQL").expect("TEST_MYSQL env var");
}
static CONN_STR: Lazy<String> = Lazy::new(|| env::var("TEST_MYSQL").expect("TEST_MYSQL env var"));

#[test]
fn should_parse_socket_url() {
Expand Down
6 changes: 2 additions & 4 deletions src/connector/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,11 @@ impl Queryable for PostgreSql {
mod tests {
use super::*;
use crate::{connector::Queryable, error::*, single::Quaint};
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use std::env;
use url::Url;

lazy_static! {
static ref CONN_STR: String = env::var("TEST_PSQL").expect("TEST_PSQL env var");
}
static CONN_STR: Lazy<String> = Lazy::new(|| env::var("TEST_PSQL").expect("TEST_PSQL env var"));

#[test]
fn should_parse_socket_url() {
Expand Down
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,11 @@ pub mod prelude;
#[cfg(any(feature = "sqlite", feature = "mysql", feature = "postgresql"))]
pub mod single;
pub mod visitor;

#[cfg(feature = "serde-support")]
pub mod serde;

pub type Result<T> = std::result::Result<T, error::Error>;
use once_cell::sync::Lazy;

use lazy_static::lazy_static;
pub(crate) static LOG_QUERIES: Lazy<bool> = Lazy::new(|| std::env::var("LOG_QUERIES").map(|_| true).unwrap_or(false));

lazy_static! {
static ref LOG_QUERIES: bool = std::env::var("LOG_QUERIES").map(|_| true).unwrap_or(false);
}
pub type Result<T> = std::result::Result<T, error::Error>;

0 comments on commit 001fcdd

Please sign in to comment.