From c0d2697d647d31c8a4e1698b521d68a5a919d36d Mon Sep 17 00:00:00 2001 From: caixiangyue Date: Mon, 13 Nov 2023 14:44:48 +0800 Subject: [PATCH] chore: cargo fmt --- .github/workflows/build.yml | 2 ++ rustfmt.toml | 16 ++++++++++++++++ src/main.rs | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 rustfmt.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be06749..58ee399 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,8 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Format + run: cargo fmt --check - name: Clippy run: cargo clippy - name: Build diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..3de3c63 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,16 @@ +version = "Two" +unstable_features = true + +comment_width = 80 +wrap_comments = true +format_code_in_doc_comments = true +format_macro_bodies = true +format_macro_matchers = true +normalize_comments = true +normalize_doc_attributes = true +condense_wildcard_suffixes = true +newline_style = "Unix" +use_field_init_shorthand = true +use_try_shorthand = true +imports_granularity = "Crate" +group_imports = "StdExternalCrate" diff --git a/src/main.rs b/src/main.rs index a30d2e1..3ea74b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,4 +11,4 @@ fn main() { // įžŽåŒ–打印 println!("{:?}", peter); -} \ No newline at end of file +}