hocon.rs
hocon.rs copied to clipboard
Parse HOCON configuration files in Rust
This function works as expected. ``` fn main() { let thing = r#"a = "sˢ""#; let loader = hocon::HoconLoader::new() .load_str(thing).unwrap(); let parsed = loader.hocon().unwrap(); println!("{}", parsed["a"].as_string().unwrap()); } ``` However, removing...
With Typesafe Config (authors of HOCON): ```scala println( ConfigFactory .parseString("a = 1.0.1-zxc") .getString("a") ) ``` Prints `1.0.1-zxc`. With hocon.rs 0.9.0: ```rust fn main() { let mut loader = hocon::HoconLoader::new().strict(); loader...
Updates the requirements on [nom](https://github.com/Geal/nom) to permit the latest version. Changelog Sourced from nom's changelog. 7.1.0 - 2021-11-04 Thanks @nickelc @Stargateur @NilsIrl @clonejo @Strytyp @schubart @jihchi @nipunn1313 @Gungy2 @Drumato @Alexhuszagh...
``` #[derive(Debug,Deserialize)] enum RoleType { Admin, User, VipUser, } #[derive(Debug, Deserialize)] struct User { name: String, age: u8, weight: u8, high: f32, #[serde(flatten)] role_type:RoleType } #[test] fn test01() { let...
I tried parsing a simple document with `HoconLoader::new().load_str(string)`: ``` { aaa { bbb = "ccc" } } ``` It failed with `Error::Parse`. While trying to debug it, it turns out...
I'm trying to use the following code to load a config: ```rust let tmp_conf: TestConfig = HoconLoader::new() .load_file("./tmp.conf")? .resolve()?; ``` But I get the following error: ```Error deserializing: ".: missing...
Hi, I'm using hocon 0.4.0 and serde 1.0.124. The config file says `blah = 1 second`, the config struct says `blah: std::time::Duration`, and hocon says ``` Error: Error deserializing: "blah:...
It would be great if a Hocon node could also yield its current path in the document. It should merely be a additional field in the Hocon-enum, though I could...
src/main.rs ```rust use hocon::HoconLoader; fn main() -> Result { let doc = HoconLoader::new() .load_file( "/path/to/my/hocon.conf", )? .hocon()?; println!("{:?}", doc["DefaultParsers"]); Ok(()) } ``` Panics when it loads the document (run in...