11 releases

0.3.8 Jun 4, 2024
0.3.6 Mar 18, 2024
0.3.3 Oct 7, 2023
0.3.1 Feb 1, 2023
0.3.0 Nov 26, 2021

#218 in Encoding

Download history 1711/week @ 2024-08-18 2425/week @ 2024-08-25 1826/week @ 2024-09-01 1839/week @ 2024-09-08 1567/week @ 2024-09-15 2218/week @ 2024-09-22 2175/week @ 2024-09-29 2329/week @ 2024-10-06 2166/week @ 2024-10-13 2247/week @ 2024-10-20 2257/week @ 2024-10-27 2322/week @ 2024-11-03 4141/week @ 2024-11-10 4000/week @ 2024-11-17 3252/week @ 2024-11-24 3547/week @ 2024-12-01

15,107 downloads per month
Used in 23 crates (7 directly)

MIT license

8KB
166 lines

Serde Toml Merge

codecov

Just like serde_merge, this crate allows you to merge toml values.

How to use

use serde_toml_merge::merge;
use toml::Value;

fn main() {
    let first = r#"
string = "foo"
integer = 42
float = 42.24
boolean = true
keep_me = true
"#
    .parse::<Value>()
    .unwrap();

    let second = r#"
string = "bar"
integer = 43
float = 24.42
boolean = false
missing = true
"#
    .parse::<Value>()
    .unwrap();

    let expected = r#"
string = "bar"
integer = 43
float = 24.42
boolean = false
keep_me = true
missing = true
"#
    .parse::<Value>()
    .unwrap();

    assert_eq!(merge(first, second).unwrap(), expected);
}

Dependencies

~265–510KB
~11K SLoC