Skip to content

Commit

Permalink
add newline_style and unstable_features to rustfmt.toml
Browse files Browse the repository at this point in the history
Signed-off-by: jiaxiao zhou <[email protected]>
  • Loading branch information
Mossaka committed Aug 18, 2023
1 parent 8ed5f3f commit c96251b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@nightly
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
- name: Setup build env
run: ./scripts/setup.sh
shell: bash
- run:
# needed to run rustfmt in nightly toolchain
rustup toolchain install nightly --component rustfmt
- name: Run checks
run: make check
build:
Expand Down
6 changes: 5 additions & 1 deletion crates/wasi-demo-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ fn main() {
file.write_all(args[3..].join(" ").as_bytes()).unwrap();
}
"daemon" => loop {
println!("This is a song that never ends.\nYes, it goes on and on my friends.\nSome people started singing it not knowing what it was,\nSo they'll continue singing it forever just because...\n");
println!(
"This is a song that never ends.\nYes, it goes on and on my friends.\nSome people \
started singing it not knowing what it was,\nSo they'll continue singing it \
forever just because...\n"
);
sleep(Duration::from_secs(1));
},
_ => {
Expand Down
9 changes: 5 additions & 4 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# create three groups for std, external and local crates
group_imports = "StdExternalCrate"

# https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#imports_granularity
newline_style = "Unix"
unstable_features = true # Cargo fmt now needs to be called with `cargo +nightly fmt`
group_imports = "StdExternalCrate" # create three groups for std, external and local crates
# Merge imports from the same module
# See: https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#imports_granularity
imports_granularity = "Module"

0 comments on commit c96251b

Please sign in to comment.