Describe the bug
In a multi line collection, if some lines are comments then they get deleted after format.
let a = {
my_key: "my_key"
# a comment
my_other_key: "my_other_key"
}
# becomes
let a = {
my_key: "my_key"
my_other_key: "my_other_key"
}
Steps to reproduce
- run on nufmt 0.1.0
Expected behavior
The comments should be preserved
Environment
Please run rustc --version and paste the result.
[user@system:~]$ rustc --version
rustc 1.95.0 (59807616e 2026-04-14)
If using Nix please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here
Notify maintainers
Describe the bug
In a multi line collection, if some lines are comments then they get deleted after format.
Steps to reproduce
Expected behavior
The comments should be preserved
Environment
Please run
rustc --versionand paste the result.If using Nix please run
nix-shell -p nix-info --run "nix-info -m"and paste the result.Notify maintainers