Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
edition = "2024"
unstable_features = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can enable unstable features here? TIL, this is indeed much better!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it forces you to call with cargo +nightly fmt or use the nightly toolchain directly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, also discovered this. This is a pretty big downside to be fair since now everyone will run into errors with this as it no longer works correctly with normal editor integrations. In the main iroh repo we hooked up an external cargo make format command that can format it fine with stable rust without giving errors. The benefit of that approach is that by default the formatting is close enough so that rust-analyzer etc will do the right thing and folks don't need to be aware of this. Only very occasionally will you run into CI complaining about this and having to manually run cargo make format. I appreciate you still have to install a new tool in that case.

imports_granularity = "Crate"
group_imports = "StdExternalCrate"
reorder_imports = true
format_code_in_doc_comments = true
force_explicit_abi = true
max_width = 100
merge_derives = true
newline_style = "Unix"
remove_nested_parens = true
reorder_modules = true
use_field_init_shorthand = false
use_small_heuristics = "Default"
use_try_shorthand = false
Loading