I'm using toml_edit to merge 2 toml documents for updating configuration file. Before serialization, I debug print the DocumentMut and the ast looks fine, but when calling the to_string() function, it produces invalid toml debug ast, source code:
[[edges]]
id = "edge1"
source = "inf5"
target = "inf3"
[[nodes]]
id = "inf"
type = "InputDeviceName"
[nodes.data]
matches = "Micro"
gain = 1.0
mode = "Regex"
channels = []
[nodes.position]
x = 0.0
y = 0.0
[[nodes]]
id = "inf2"
type = "InputDeviceName"
[nodes.data]
matches = "Speakers (High Definition Audio Device)"
mode = "Exact"
gain = 1.0
channels = []
[nodes.position]
x = 0.0
y = 249.0
[[nodes]]
id = "inf3"
type = "OutputDeviceName"
[nodes.data]
matches = "Sp"
gain = 1.0
mode = "Regex"
channels = []
[[nodes]]
id = "inf4"
type = "ProcessCaptureName"
[nodes.position]
x = 291.0
y = 747.0
[nodes.data]
matches = "osu"
gain = 1.0
mode = "Regex"
channels = []
[[nodes]]
id = "inf5"
type = "ProcessCaptureWinTitle"
[nodes.data]
matches = "BSPow"
gain = 1.0
mode = "Regex"
channels = []
[nodes.position]
x = 0.0
y = 498.0
[nodes.position]
x = 0.0
y = 747.0
seems like "inf3" node position had been "pushed down" to "inf4" node which cascade down to others node under it. I tried to fix this by hand and do another debug print and use a diff tool and nothing could indicate a problem.
I'm using
toml_editto merge 2 toml documents for updating configuration file. Before serialization, I debug print theDocumentMutand the ast looks fine, but when calling theto_string()function, it produces invalid toml debug ast, source code:seems like "inf3" node position had been "pushed down" to "inf4" node which cascade down to others node under it. I tried to fix this by hand and do another debug print and use a diff tool and nothing could indicate a problem.