Skip to content
New issue

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

Add .rustfmt.toml, specify edition = "2021" #745

Merged
merged 1 commit into from
May 20, 2024

Conversation

alisianoi
Copy link
Contributor

There are two common ways to run rustfmt:

$ cargo fmt
$ rustfmt

In the first case, Cargo.toml will be used to configure rustfmt. In the second case, Cargo.toml won't be used and rustfmt will assume certain defaults. Specifically, it will default to Rust 2015 edition which for the quick-xml project results in errors like:

[E0670]: async fn is not permitted in Rust 2015

One of the scenarios when rustfmt is called instead of cargo fmt is "rustic" mode in emacs. The developers of "rustic" mode ask to configure .rustfmt.toml:

See: https://github.com/brotzeit/rustic?tab=readme-ov-file#edition-2018

There are two common ways to run rustfmt:

  $ cargo fmt
  $ rustfmt

In the first case, Cargo.toml will be used to configure rustfmt. In the
second case, Cargo.toml won't be used and rustfmt will assume certain
defaults. Specifically, it will default to Rust 2015 edition which for
the quick-xml project results in errors like:

[E0670]: async fn is not permitted in Rust 2015

One of the scenarios when rustfmt is called instead of cargo fmt is "rustic"
mode in emacs. The developers of "rustic" mode ask to configure .rustfmt.toml:

See: https://github.com/brotzeit/rustic?tab=readme-ov-file#edition-2018    Add .rustfmt.toml, specify edition = "2021"
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.19%. Comparing base (5d76174) to head (7d19cf1).
Report is 9 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #745      +/-   ##
==========================================
- Coverage   61.24%   61.19%   -0.06%     
==========================================
  Files          39       39              
  Lines       16277    16235      -42     
==========================================
- Hits         9969     9935      -34     
+ Misses       6308     6300       -8     
Flag Coverage Δ
unittests 61.19% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Mingun Mingun merged commit 499dbaf into tafia:master May 20, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants