chore: add static feature as default

This commit is contained in:
Dmitriy Pleshevskiy 2020-02-11 09:32:10 +03:00
parent 1088a53903
commit 7d4c549272
7 changed files with 10 additions and 11 deletions

View file

@ -1,7 +1,7 @@
# itconfig # itconfig
[![Build Status](https://travis-ci.org/icetemple/itconfig-rs.svg?branch=master)](https://travis-ci.org/icetemple/itconfig-rs) [![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) [![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) [![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. Easy build a configs from environment variables and use it in globally.
@ -119,7 +119,7 @@ cargo test
## Available features ## Available features
* **default** - ["macro", "primitives"] * **default** - ["macro", "primitives", "static"]
* **macro** - Activates `config!` macros for easy configure web application. * **macro** - Activates `config!` macros for easy configure web application.
* **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package). * **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package).
* **array** - Add EnvString impl for vector type (uses optional `serde_json` package). * **array** - Add EnvString impl for vector type (uses optional `serde_json` package).

View file

@ -13,4 +13,4 @@ serde_json = "1.0"
tokio = { version = "0.2", features = ["macros"] } tokio = { version = "0.2", features = ["macros"] }
bytes = "0.5" bytes = "0.5"
futures-util = { version = "0.3", default-features = false } futures-util = { version = "0.3", default-features = false }
pretty_env_logger = "0.3" pretty_env_logger = "0.3"

View file

@ -14,9 +14,8 @@ criterion = "0.3.1"
lazy_static = "1.4.0" lazy_static = "1.4.0"
[features] [features]
default = ["meta_namespace", "static"] default = ["meta_namespace"]
meta_namespace = [] meta_namespace = []
static = ["itconfig/static"]
[[bench]] [[bench]]
name = "main_benches" name = "main_benches"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "itconfig" name = "itconfig"
version = "0.11.0" version = "0.11.1"
authors = ["Dmitriy Pleshevskiy <dmitriy@ideascup.me>"] authors = ["Dmitriy Pleshevskiy <dmitriy@ideascup.me>"]
description = "Easy build a configs from environment variables and use it in globally." description = "Easy build a configs from environment variables and use it in globally."
categories = ["config", "web-programming"] categories = ["config", "web-programming"]
@ -20,7 +20,7 @@ lazy_static = { version = "1.4.0", optional = true }
serde_json = { version = "1.0.44", optional = true } serde_json = { version = "1.0.44", optional = true }
[features] [features]
default = ["macro", "primitives"] default = ["macro", "primitives", "static"]
macro = [] macro = []
static = ["lazy_static"] static = ["lazy_static"]

View file

@ -100,7 +100,7 @@ fn main() {
## Available features ## Available features
* **default** - ["macro", "primitives"] * **default** - ["macro", "primitives", "static"]
* **macro** - Activates `config!` macros for easy configure web application. * **macro** - Activates `config!` macros for easy configure web application.
* **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package). * **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package).
* **array** - Add EnvString impl for vector type (uses optional `serde_json` package). * **array** - Add EnvString impl for vector type (uses optional `serde_json` package).

View file

@ -89,7 +89,7 @@
//! //!
//! ## Available features //! ## Available features
//! //!
//! * **default** - ["macro", "primitives"] //! * **default** - ["macro", "primitives", "static"]
//! * **macro** - Activates `config!` macros for easy configure web application. //! * **macro** - Activates `config!` macros for easy configure web application.
//! * **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package). //! * **static** - Add `static` option to `config!` macros (uses optional `lazy_static` package).
//! * **array** - Add EnvString impl for vector type (uses optional `serde_json` package). //! * **array** - Add EnvString impl for vector type (uses optional `serde_json` package).
@ -130,7 +130,7 @@
#[macro_use] #[macro_use]
extern crate failure; extern crate failure;
#[cfg(feature = "static")] #[cfg(feature = "static")]
extern crate lazy_static; pub extern crate lazy_static;
mod enverr; mod enverr;
mod getenv; mod getenv;

View file

@ -665,7 +665,7 @@ macro_rules! __itconfig_impl_namespace {
pub mod $mod_name { pub mod $mod_name {
#![allow(non_snake_case)] #![allow(non_snake_case)]
#[cfg(feature = "static")] #[cfg(feature = "static")]
use lazy_static::lazy_static; use $crate::lazy_static::lazy_static;
$(__itconfig_impl_namespace! { $(__itconfig_impl_namespace! {
variables = $ns_variable, variables = $ns_variable,