use json_ops::ValuePath;
fn main()
{
let str_toml = include_str!("./sample.toml");
let mut v: toml::Value = str_toml.parse().unwrap();
println!("original toml content:");
println!("{str_toml}");
println!("modify by path:");
let node = v.path_mut() / "ip";
let _ = node << "127.0.0.2";
let mut node = v.path_mut() / "host";
node = node << ("newkey1", 1) << ("newkey2", "2");
let _ = node / "port" << 8888;
node = v.path_mut() / "host" /"protocol";
let _ = node << (8989,) << ("xyz",);
let _ = v.path_mut() / "misc" / "bool" << "false";
println!("{}", v);
}