I've run into some possible edge case with rustfmt - it fails to format my code, either via editor action (from Rust Analyzer) or from cargo fmt
. This happens with some deeply nested code, like this:
pub struct Foo;
impl Foo {
fn foo() {
{
self.bar(|| async move {
{
{
{
{
{
if let Err(_) = res {
} else {
log::info!(
"Logging relatively long info message, with included ID={}",
id
);
}
}
}
}
}
}
});
}
}
}
Playground - the behavior is reproduced there (with Tools - Rustfmt). This seems to be a fairly minimal example - removing anything from this code allows rustfmt to work again.
Should I file an issue on the repo, or is there anything I can do with configuration?