Skip to content

Commit 2a6ec44

Browse files
committed
chore: Review feedback
- `ura` => `gura` corrections - `src/lib.rs` add mention for Gura support tests(fix): Use `FileFormat::Gura` chore: Version bump `gura` Signed-off-by: Brennan Kinney <[email protected]>
1 parent 66eb754 commit 2a6ec44

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ edition = "2018"
1515
maintenance = { status = "actively-developed" }
1616

1717
[features]
18-
default = ["toml", "json", "yaml", "ini", "ron", "json5", "ura", "convert-case", "async"]
18+
default = ["toml", "json", "yaml", "ini", "ron", "json5", "gura", "convert-case", "async"]
1919
json = ["serde_json"]
2020
yaml = ["yaml-rust"]
2121
ini = ["rust-ini"]
@@ -37,7 +37,7 @@ yaml-rust = { version = "0.4", optional = true }
3737
rust-ini = { version = "0.19", optional = true }
3838
ron = { version = "0.8", optional = true }
3939
json5_rs = { version = "0.4", optional = true, package = "json5" }
40-
gura = { version = "0.3.0", optional = true, package = "gura" }
40+
gura = { version = "0.5", optional = true, package = "gura" }
4141
indexmap = { version = "2.0.0", features = ["serde"], optional = true }
4242
convert_case = { version = "0.6", optional = true }
4343
pathdiff = "0.2"

src/file/format/mod.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mod ron;
2727
#[cfg(feature = "json5")]
2828
mod json5;
2929

30-
#[cfg(feature = "ura")]
30+
#[cfg(feature = "gura")]
3131
mod gura;
3232

3333
/// File formats provided by the library.
@@ -59,8 +59,8 @@ pub enum FileFormat {
5959
#[cfg(feature = "json5")]
6060
Json5,
6161

62-
/// GURA (parsed with ura)
63-
#[cfg(feature = "ura")]
62+
/// GURA (parsed with gura)
63+
#[cfg(feature = "gura")]
6464
Gura,
6565
}
6666

@@ -88,7 +88,7 @@ lazy_static! {
8888
#[cfg(feature = "json5")]
8989
formats.insert(FileFormat::Json5, vec!["json5"]);
9090

91-
#[cfg(feature = "ura")]
91+
#[cfg(feature = "gura")]
9292
formats.insert(FileFormat::Gura, vec!["ura"]);
9393

9494
formats
@@ -127,7 +127,7 @@ impl FileFormat {
127127
#[cfg(feature = "json5")]
128128
FileFormat::Json5 => json5::parse(uri, text),
129129

130-
#[cfg(feature = "ura")]
130+
#[cfg(feature = "gura")]
131131
FileFormat::Gura => gura::parse(uri, text),
132132

133133
#[cfg(all(
@@ -137,6 +137,7 @@ impl FileFormat {
137137
not(feature = "ini"),
138138
not(feature = "ron"),
139139
not(feature = "json5"),
140+
not(feature = "gura"),
140141
))]
141142
_ => unreachable!("No features are enabled, this library won't work without features"),
142143
}

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! - Environment variables
77
//! - String literals in well-known formats
88
//! - Another Config instance
9-
//! - Files: TOML, JSON, YAML, INI, RON, JSON5 and custom ones defined with Format trait
9+
//! - Files: TOML, JSON, YAML, INI, RON, JSON5, GURA and custom ones defined with Format trait
1010
//! - Manual, programmatic override (via a `.set` method on the Config instance)
1111
//!
1212
//! Additionally, Config supports:

tests/file_gura.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg(feature = "json")]
1+
#![cfg(feature = "gura")]
22

33
use serde_derive::Deserialize;
44

@@ -185,7 +185,7 @@ fn test_override_lowercase_value_for_enums() {
185185
std::env::set_var("test_bar", "I have been overridden_with_lower_case");
186186

187187
let cfg = Config::builder()
188-
.add_source(File::new("tests/Settings-enum-test", FileFormat::Json))
188+
.add_source(File::new("tests/Settings-enum-test", FileFormat::Gura))
189189
.add_source(config::Environment::with_prefix("test").separator("_"))
190190
.build()
191191
.unwrap();

0 commit comments

Comments
 (0)