Input code
// Default rustfmt
let data =
fs::read_to_string(&json_path).unwrap_or_else(|_| panic!("Unable to read {:?}", json_path));
Output code
// prettier-plugin-rust
let data = fs
::read_to_string(&json_path)
.unwrap_or_else(|_| panic!("Unable to read {:?}", json_path));
Additional context
fs::read_to_string shouldn't be broken across lines, it's a single qualified value.
It only does this sometimes, not in a way that I can reproduce. There's many other cases in my code where it didn't do this, for example:
DefaultMakeSpan::new().include_headers(true).level(tracing::Level::DEBUG)
Input code
Output code
Additional context
fs::read_to_stringshouldn't be broken across lines, it's a single qualified value.It only does this sometimes, not in a way that I can reproduce. There's many other cases in my code where it didn't do this, for example: