We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit (simplified):
Output of rustfmt on nightly-2024-03-08:
fn main() { app.with_state() .layer(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx( |foo: &Xxxxxxxxx| macroxxxx!(??xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx), )); }
Expected:
fn main() { app.with_state() .layer(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(|foo: &Xxxxxxxxx| { macroxxxx!(??xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) })); }
This code:
fn main() { let app = app .with_state(build_schema().await) .layer(TraceLayer::new_for_http().make_span_with( |req: &Request<_>| info_span!("req", method=?req.method(), path=req.uri().to_string()), )); }
formats to:
❮ rustfmt +nightly-2024-03-08 b.rs --emit stdout /tmp/ktmp/SgB/b.rs: fn main() { let app = app.with_state(build_schema().await) .layer(TraceLayer::new_for_http().make_span_with( |req: &Request<_>| info_span!("req", method=?req.method(), path=req.uri().to_string()), )); }
I think leaving the original code is fine. Or maybe It's ideal to indent the argument one more block like this:
fn main() { let app = app.with_state(build_schema().await) .layer(TraceLayer::new_for_http().make_span_with( |req: &Request<_>| info_span!("req", method=?req.method(), path=req.uri().to_string()), )); }
because rustfmt emits like so if the argument was normal function call. For example:
❯ rustfmt +nightly-2024-03-08 a.rs --emit stdout /tmp/ktmp/SgB/a.rs: fn main() { let app = app.with_state(build_schema().await) .layer(TraceLayer::new_for_http().make_span_with( sooooooooooooooooooooooooooooooooooooooo_long_function_call_here(foo, bar, baz), )); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Edit (simplified):
Output of rustfmt on nightly-2024-03-08:
Expected:
original report
This code:
formats to:
I think leaving the original code is fine. Or maybe It's ideal to indent the argument one more block like this:
because rustfmt emits like so if the argument was normal function call. For example:
The text was updated successfully, but these errors were encountered: