From 7d4c549272e56666ec3045db941d26443188f079 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 11 Feb 2020 09:32:10 +0300 Subject: [PATCH] chore: add static feature as default --- README.md | 4 ++-- examples/hyper/Cargo.toml | 2 +- itconfig-tests/Cargo.toml | 3 +-- itconfig/Cargo.toml | 4 ++-- itconfig/README.md | 2 +- itconfig/src/lib.rs | 4 ++-- itconfig/src/macro.rs | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1a46aab..9569be4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # itconfig [![Build Status](https://travis-ci.org/icetemple/itconfig-rs.svg?branch=master)](https://travis-ci.org/icetemple/itconfig-rs) [![Documentation](https://docs.rs/itconfig/badge.svg)](https://docs.rs/itconfig) -[![Crates.io](https://img.shields.io/badge/crates.io-v0.11.0-orange.svg?longCache=true)](https://crates.io/crates/itconfig) +[![Crates.io](https://img.shields.io/badge/crates.io-v0.11.1-orange.svg?longCache=true)](https://crates.io/crates/itconfig) [![Join the chat at https://gitter.im/icetemple/itconfig-rs](https://badges.gitter.im/icetemple/itconfig-rs.svg)](https://gitter.im/icetemple/itconfig-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Easy build a configs from environment variables and use it in globally. @@ -119,7 +119,7 @@ cargo test ## Available features -* **default** - ["macro", "primitives"] +* **default** - ["macro", "primitives", "static"] * **macro** - Activates `config!` macros for easy configure web application. * **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package). * **array** - Add EnvString impl for vector type (uses optional `serde_json` package). diff --git a/examples/hyper/Cargo.toml b/examples/hyper/Cargo.toml index 1b2e212..640780a 100644 --- a/examples/hyper/Cargo.toml +++ b/examples/hyper/Cargo.toml @@ -13,4 +13,4 @@ serde_json = "1.0" tokio = { version = "0.2", features = ["macros"] } bytes = "0.5" futures-util = { version = "0.3", default-features = false } -pretty_env_logger = "0.3" \ No newline at end of file +pretty_env_logger = "0.3" diff --git a/itconfig-tests/Cargo.toml b/itconfig-tests/Cargo.toml index f02b22a..fbc6ede 100644 --- a/itconfig-tests/Cargo.toml +++ b/itconfig-tests/Cargo.toml @@ -14,9 +14,8 @@ criterion = "0.3.1" lazy_static = "1.4.0" [features] -default = ["meta_namespace", "static"] +default = ["meta_namespace"] meta_namespace = [] -static = ["itconfig/static"] [[bench]] name = "main_benches" diff --git a/itconfig/Cargo.toml b/itconfig/Cargo.toml index 6d39480..ff4d912 100644 --- a/itconfig/Cargo.toml +++ b/itconfig/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "itconfig" -version = "0.11.0" +version = "0.11.1" authors = ["Dmitriy Pleshevskiy "] description = "Easy build a configs from environment variables and use it in globally." categories = ["config", "web-programming"] @@ -20,7 +20,7 @@ lazy_static = { version = "1.4.0", optional = true } serde_json = { version = "1.0.44", optional = true } [features] -default = ["macro", "primitives"] +default = ["macro", "primitives", "static"] macro = [] static = ["lazy_static"] diff --git a/itconfig/README.md b/itconfig/README.md index 6af0f83..3e46d6d 100644 --- a/itconfig/README.md +++ b/itconfig/README.md @@ -100,7 +100,7 @@ fn main() { ## Available features -* **default** - ["macro", "primitives"] +* **default** - ["macro", "primitives", "static"] * **macro** - Activates `config!` macros for easy configure web application. * **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package). * **array** - Add EnvString impl for vector type (uses optional `serde_json` package). diff --git a/itconfig/src/lib.rs b/itconfig/src/lib.rs index e260566..39c2b9e 100644 --- a/itconfig/src/lib.rs +++ b/itconfig/src/lib.rs @@ -89,7 +89,7 @@ //! //! ## Available features //! -//! * **default** - ["macro", "primitives"] +//! * **default** - ["macro", "primitives", "static"] //! * **macro** - Activates `config!` macros for easy configure web application. //! * **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package). //! * **array** - Add EnvString impl for vector type (uses optional `serde_json` package). @@ -130,7 +130,7 @@ #[macro_use] extern crate failure; #[cfg(feature = "static")] -extern crate lazy_static; +pub extern crate lazy_static; mod enverr; mod getenv; diff --git a/itconfig/src/macro.rs b/itconfig/src/macro.rs index a4b7a84..bb43b1f 100644 --- a/itconfig/src/macro.rs +++ b/itconfig/src/macro.rs @@ -665,7 +665,7 @@ macro_rules! __itconfig_impl_namespace { pub mod $mod_name { #![allow(non_snake_case)] #[cfg(feature = "static")] - use lazy_static::lazy_static; + use $crate::lazy_static::lazy_static; $(__itconfig_impl_namespace! { variables = $ns_variable,