Skip to content

Commit

Permalink
Remove support for hjson
Browse files Browse the repository at this point in the history
The serde-hjson crate is not maintained anymore and this feature is
actually causing pain in packaging even.

Thus, remove it.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
  • Loading branch information
matthiasbeyer committed Oct 2, 2021
1 parent 052c950 commit 7485f27
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 254 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ edition = "2018"
maintenance = { status = "actively-developed" }

[features]
default = ["toml", "json", "yaml", "hjson", "ini", "ron", "json5"]
default = ["toml", "json", "yaml", "ini", "ron", "json5"]
json = ["serde_json"]
yaml = ["yaml-rust"]
hjson = ["serde-hjson"]
ini = ["rust-ini"]
json5 = ["json5_rs"]
preserve_order = ["indexmap", "toml/preserve_order", "serde_json/preserve_order", "ron/indexmap"]
Expand All @@ -32,7 +31,6 @@ nom = "6"
toml = { version = "0.5", optional = true }
serde_json = { version = "1.0.2", optional = true }
yaml-rust = { version = "0.4", optional = true }
serde-hjson = { version = "0.9", default-features = false, optional = true }
rust-ini = { version = "0.17", optional = true }
ron = { version = "0.6", optional = true }
json5_rs = { version = "0.3", optional = true, package = "json5" }
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@

- Set defaults
- Set explicit values (to programmatically override)
- Read from [JSON], [TOML], [YAML], [HJSON], [INI], [RON], [JSON5] files
- Read from [JSON], [TOML], [YAML], [INI], [RON], [JSON5] files
- Read from environment
- Loosely typed — Configuration values may be read in any supported type, as long as there exists a reasonable conversion
- Access nested fields using a formatted path — Uses a subset of JSONPath; currently supports the child ( `redis.port` ) and subscript operators ( `databases[0].name` )

[JSON]: https://github.com/serde-rs/json
[TOML]: https://github.com/toml-lang/toml
[YAML]: https://github.com/chyh1990/yaml-rust
[HJSON]: https://github.com/hjson/hjson-rust
[INI]: https://github.com/zonyitoo/rust-ini
[RON]: https://github.com/ron-rs/ron
[JSON5]: https://github.com/callum-oakley/json5-rs
Expand All @@ -33,7 +32,6 @@ config = "0.11"

- `ini` - Adds support for reading INI files
- `json` - Adds support for reading JSON files
- `hjson` - Adds support for reading HJSON files
- `yaml` - Adds support for reading YAML files
- `toml` - Adds support for reading TOML files
- `ron` - Adds support for reading RON files
Expand Down
54 changes: 0 additions & 54 deletions src/file/format/hjson.rs

This file was deleted.

13 changes: 0 additions & 13 deletions src/file/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ mod json;
#[cfg(feature = "yaml")]
mod yaml;

#[cfg(feature = "hjson")]
mod hjson;

#[cfg(feature = "ini")]
mod ini;

Expand All @@ -43,10 +40,6 @@ pub enum FileFormat {
#[cfg(feature = "yaml")]
Yaml,

/// HJSON (parsed with serde_hjson)
#[cfg(feature = "hjson")]
Hjson,

/// INI (parsed with rust_ini)
#[cfg(feature = "ini")]
Ini,
Expand Down Expand Up @@ -75,9 +68,6 @@ lazy_static! {
#[cfg(feature = "yaml")]
formats.insert(FileFormat::Yaml, vec!["yaml", "yml"]);

#[cfg(feature = "hjson")]
formats.insert(FileFormat::Hjson, vec!["hjson"]);

#[cfg(feature = "ini")]
formats.insert(FileFormat::Ini, vec!["ini"]);

Expand Down Expand Up @@ -119,9 +109,6 @@ impl FileFormat {
#[cfg(feature = "yaml")]
FileFormat::Yaml => yaml::parse(uri, text),

#[cfg(feature = "hjson")]
FileFormat::Hjson => hjson::parse(uri, text),

#[cfg(feature = "ini")]
FileFormat::Ini => ini::parse(uri, text),

Expand Down
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! - Environment variables
//! - Another Config instance
//! - Remote configuration: etcd, Consul
//! - Files: TOML, JSON, YAML, HJSON, INI, RON, JSON5
//! - Files: TOML, JSON, YAML, INI, RON, JSON5
//! - Manual, programmatic override (via a `.set` method on the Config instance)
//!
//! Additionally, Config supports:
Expand Down Expand Up @@ -41,9 +41,6 @@ extern crate serde_json;
#[cfg(feature = "yaml")]
extern crate yaml_rust;

#[cfg(feature = "hjson")]
extern crate serde_hjson;

#[cfg(feature = "ini")]
extern crate ini;

Expand Down
19 changes: 0 additions & 19 deletions tests/datetime.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![cfg(all(
feature = "toml",
feature = "json",
feature = "hjson",
feature = "yaml",
feature = "ini",
feature = "ron",
Expand Down Expand Up @@ -35,14 +34,6 @@ fn make() -> Config {
"#,
FileFormat::Toml,
))
.add_source(File::from_str(
r#"
{
"hjson_datetime": "2017-05-10T02:14:53Z"
}
"#,
FileFormat::Hjson,
))
.add_source(File::from_str(
r#"
ini_datetime = 2017-05-10T02:14:53Z
Expand Down Expand Up @@ -80,11 +71,6 @@ fn test_datetime_string() {

assert_eq!(&date, "2017-06-12T10:58:30Z");

// HJSON
let date: String = s.get("hjson_datetime").unwrap();

assert_eq!(&date, "2017-05-10T02:14:53Z");

// INI
let date: String = s.get("ini_datetime").unwrap();

Expand Down Expand Up @@ -115,11 +101,6 @@ fn test_datetime() {

assert_eq!(date, Utc.ymd(2017, 6, 12).and_hms(10, 58, 30));

// HJSON
let date: DateTime<Utc> = s.get("hjson_datetime").unwrap();

assert_eq!(date, Utc.ymd(2017, 5, 10).and_hms(2, 14, 53));

// INI
let date: DateTime<Utc> = s.get("ini_datetime").unwrap();

Expand Down
80 changes: 0 additions & 80 deletions tests/file_hjson.rs

This file was deleted.

77 changes: 0 additions & 77 deletions tests/legacy/file_hjson.rs

This file was deleted.

1 change: 0 additions & 1 deletion tests/legacy/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod datetime;
pub mod errors;
pub mod file;
pub mod file_hjson;
pub mod file_ini;
pub mod file_json;
pub mod file_ron;
Expand Down

0 comments on commit 7485f27

Please sign in to comment.