You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
The formatting which is created by dx fmt is not accepted by cargo fmt --check.
Steps To Reproduce
Steps to reproduce the behavior:
create a new dioxus project with the following main.rs
use dioxus::prelude::*;fnmain(){
dioxus::launch(App);}enumBookType{AudioBook,EBook,}#[component]fnApp() -> Element{let value = BookType::AudioBook;rsx!{"hello world"match value {BookType::AudioBook => rsx! {
div {"audio icon eeeeeeeeeeeeeeeeeeeeeeeeee"}},BookType::EBook => rsx! {
div {"book icon eeeeeeeeeeeeeeeeeeeeeeeeeee"}},}}}
the code was formatted with cargo fmt and the following rustfmt.toml config:
edition = "2021"hard_tabs = truetab_spaces = 4
run dx fmt and you get the follwing code:
use dioxus::prelude::*;fnmain(){
dioxus::launch(App);}enumBookType{AudioBook,EBook,}#[component]fnApp() -> Element{let value = BookType::AudioBook;rsx!{"hello world"match value {BookType::AudioBook => rsx! {
div {"audio icon eeeeeeeeeeeeeeeeeeeeeeeeee"}},BookType::EBook => rsx! {
div {"book icon eeeeeeeeeeeeeeeeeeeeeeeeeee"}},}}}
This code has 2 tabs and 4 space in front of the BookType instead of 3 tabs.
Create code which is accepted by cargo fmt --check
Screenshots
Additional Information
I use dx fmt and cargo +nightly fmt both for formatting, since dx did not support the nightly features of cargo fmt.
Running dx fmt even without--all-code did change a lot cargo fmt nightly formatting.
So i regular run dx fmt first and then cargo +nightly fmt to be able to format rsx and get the cargo fmt nightly features.
To check if the code is formatted i run the following commands at the CI:
Problem
The formatting which is created by
dx fmt
is not accepted bycargo fmt --check
.Steps To Reproduce
Steps to reproduce the behavior:
create a new dioxus project with the following
main.rs
the code was formatted with
cargo fmt
and the followingrustfmt.toml
config:run
dx fmt
and you get the follwing code:This code has 2 tabs and 4 space in front of the
BookType
instead of 3 tabs.Expected behavior
BookType
cargo fmt --check
Screenshots
Additional Information
I use
dx fmt
andcargo +nightly fmt
both for formatting, since dx did not support the nightly features ofcargo fmt
.Running
dx fmt
even without--all-code
did change a lotcargo fmt
nightly formatting.So i regular run
dx fmt
first and thencargo +nightly fmt
to be able to format rsx and get the cargo fmt nightly features.To check if the code is formatted i run the following commands at the CI:
However this fail because
dx fmt
format the at different way ascargo fmt
.Environment:
Questionnaire
The text was updated successfully, but these errors were encountered: