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

#225 in Encoding

Download history 2200/week @ 2024-07-23 1888/week @ 2024-07-30 2219/week @ 2024-08-06 1622/week @ 2024-08-13 1911/week @ 2024-08-20 2281/week @ 2024-08-27 2103/week @ 2024-09-03 1639/week @ 2024-09-10 1506/week @ 2024-09-17 2202/week @ 2024-09-24 2381/week @ 2024-10-01 2167/week @ 2024-10-08 2371/week @ 2024-10-15 2225/week @ 2024-10-22 2154/week @ 2024-10-29 2434/week @ 2024-11-05

9,417 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