From e6694060edcfafd1977192ace7060d7d3acb11a1 Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Thu, 24 Oct 2024 12:09:33 +0200 Subject: [PATCH] style: add rustfmt.toml --- .github/workflows/rust.yml | 4 +--- rustfmt.toml | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 rustfmt.toml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 67a3bc5..0f53d21 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,10 +16,8 @@ jobs: rustfmt: runs-on: ubuntu-latest steps: - - name: Setup Rust - uses: dtolnay/rust-toolchain@master + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: stable components: rustfmt - uses: actions/checkout@v4 - run: cargo fmt --check --verbose diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..c612a43 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,8 @@ +# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md +format_code_in_doc_comments = true +format_macro_matchers = true +group_imports = "StdExternalCrate" +imports_granularity = "Module" +normalize_doc_attributes = true +reorder_impl_items = true +use_field_init_shorthand = true