#serde #merge #toml

serde-toml-merge

Merge your toml values

7 releases

0.3.4 Feb 1, 2024
0.3.3 Oct 7, 2023
0.3.2 Sep 13, 2023
0.3.1 Feb 1, 2023
0.1.0 Nov 25, 2021

#284 in Encoding

Download history 2277/week @ 2023-11-07 2018/week @ 2023-11-14 1446/week @ 2023-11-21 2301/week @ 2023-11-28 1845/week @ 2023-12-05 1970/week @ 2023-12-12 2463/week @ 2023-12-19 871/week @ 2023-12-26 2519/week @ 2024-01-02 2805/week @ 2024-01-09 2353/week @ 2024-01-16 2647/week @ 2024-01-23 3015/week @ 2024-01-30 3477/week @ 2024-02-06 3265/week @ 2024-02-13 2535/week @ 2024-02-20

12,815 downloads per month
Used in 2 crates

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

~275–530KB
~11K SLoC