diff --git a/Cargo.lock b/Cargo.lock index 17c918f..0130327 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,9 +173,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", @@ -281,12 +281,6 @@ version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" -[[package]] -name = "linked-hash-map" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" - [[package]] name = "log" version = "0.4.14" @@ -534,14 +528,15 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.26" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "826f989c0f374733af6c286f4822f293bc738def07e2782dc1cbb899960a504a" dependencies = [ "indexmap", + "itoa", "ryu", "serde", - "yaml-rust", + "unsafe-libyaml", ] [[package]] @@ -644,6 +639,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +[[package]] +name = "unsafe-libyaml" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dc1c637311091be28e5d462c07db78081e5828da80ba22605c81c4ad6f7f813" + [[package]] name = "version_check" version = "0.9.4" @@ -689,12 +690,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] diff --git a/Cargo.toml b/Cargo.toml index 7c5ecf5..a1a8161 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ documentation = "https://docs.rs/jyt" clap = { version = "3.2", features = ["derive"] } serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["preserve_order"] } -serde_yaml = "0.8" +serde_yaml = "0.9" toml = { version = "0.5", features = ["preserve_order"] } thiserror = "1.0" diff --git a/README.md b/README.md index c24e31b..82f05a8 100644 --- a/README.md +++ b/README.md @@ -84,16 +84,15 @@ SUBCOMMANDS: ```yaml $ cat ./examples/example.json | jyt json-to-yaml ---- title: TOML Example owner: name: Tom Preston-Werner database: server: 192.168.1.1 ports: - - 8000 - - 8001 - - 8002 + - 8000 + - 8001 + - 8002 connection_max: 5000 enabled: true ``` @@ -178,16 +177,15 @@ $ cat ./examples/example.toml | jyt tj ```yaml $ cat ./examples/example.toml | jyt ty ---- title: TOML Example owner: name: Tom Preston-Werner database: server: 192.168.1.1 ports: - - 8000 - - 8001 - - 8002 + - 8000 + - 8001 + - 8002 connection_max: 5000 enabled: true ``` @@ -207,16 +205,15 @@ $ echo $? ```bash $ cat ./examples/example.toml | wapm run jyt -- toml2yaml ---- title: TOML Example owner: name: Tom Preston-Werner database: server: 192.168.1.1 ports: - - 8000 - - 8001 - - 8002 + - 8000 + - 8001 + - 8002 connection_max: 5000 enabled: true ``` diff --git a/examples/example.yaml b/examples/example.yaml index 1c239c4..674e196 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -1,12 +1,11 @@ ---- title: TOML Example owner: name: Tom Preston-Werner database: server: 192.168.1.1 ports: - - 8000 - - 8001 - - 8002 + - 8000 + - 8001 + - 8002 connection_max: 5000 enabled: true diff --git a/src/c_api.rs b/src/c_api.rs index 77dd549..50f3fb7 100644 --- a/src/c_api.rs +++ b/src/c_api.rs @@ -77,16 +77,15 @@ pub(crate) mod tests { } }"#; - pub(crate) static YAML: &str = r#"--- -title: TOML Example + pub(crate) static YAML: &str = r#"title: TOML Example owner: name: Tom Preston-Werner database: server: 192.168.1.1 ports: - - 8000 - - 8001 - - 8002 + - 8000 + - 8001 + - 8002 connection_max: 5000 enabled: true "#; @@ -181,16 +180,15 @@ enabled = true int main() { const char* input = - "---\n" "title: TOML Example\n" "owner:\n" " name: Tom Preston-Werner\n" "database:\n" " server: 192.168.1.1\n" " ports:\n" - " - 8000\n" - " - 8001\n" - " - 8002\n" + " - 8000\n" + " - 8001\n" + " - 8002\n" " connection_max: 5000\n" " enabled: true\n"; char* output = to_json(Yaml, input); @@ -211,16 +209,15 @@ enabled = true int main() { const char* input = - "---\n" "title: TOML Example\n" "owner:\n" " name: Tom Preston-Werner\n" "database:\n" " server: 192.168.1.1\n" " ports:\n" - " - 8000\n" - " - 8001\n" - " - 8002\n" + " - 8000\n" + " - 8001\n" + " - 8002\n" " connection_max: 5000\n" " enabled: true\n"; char* output = to_toml(Yaml, input);