diff --git a/rustfmt.toml b/fmt/rustfmt.toml similarity index 96% rename from rustfmt.toml rename to fmt/rustfmt.toml index a343e24..35448ce 100644 --- a/rustfmt.toml +++ b/fmt/rustfmt.toml @@ -1,19 +1,19 @@ -edition = "2018" +edition = "2021" +enum_discrim_align_threshold = 20 fn_params_layout = "Tall" force_explicit_abi = true hard_tabs = false +imports_granularity = "Crate" max_width = 100 merge_derives = true -imports_granularity = "Crate" newline_style = "Auto" remove_nested_parens = true reorder_imports = true reorder_modules = true +struct_field_align_threshold = 20 tab_spaces = 4 +trailing_comma = "Vertical" +unstable_features = true use_field_init_shorthand = false use_small_heuristics = "Default" use_try_shorthand = true -trailing_comma = "Vertical" -struct_field_align_threshold = 20 -enum_discrim_align_threshold = 20 -unstable_features = true diff --git a/justfile b/justfile index 9e36ccd..a96c9c3 100644 --- a/justfile +++ b/justfile @@ -1,7 +1,14 @@ -# Run clippy with the --fix flag -fix: - cd {{invocation_directory()}}; cargo clippy --fix --all-targets --all-features +# Justfiles are processed by the just command runner (https://just.systems/). -# Run nightly cargo format +# You can install it with `brew install just` or `cargo install just` +_default: + just --list + +# Run rustfmt fmt: - cargo +nightly fmt --all + rustup run nightly cargo fmt -- \ + --config-path ./fmt/rustfmt.toml + +# Run clippy fix and rustfmt afterwards +fix *args: && fmt + cd {{ invocation_directory() }}; cargo clippy --fix --all-targets --all-features {{ args }} diff --git a/src/take.rs b/src/take.rs index fc2b60b..df4a4fa 100644 --- a/src/take.rs +++ b/src/take.rs @@ -83,7 +83,7 @@ pub fn process_response<'a, 'b>( "{}", PrettyDifference { expected: &frame.response.to_string_pretty()?, - actual: &payload_response.to_string_pretty()?, + actual: &payload_response.to_string_pretty()?, } ); error!( @@ -327,10 +327,10 @@ mod tests { ) .unwrap(); let payload_response = Response { - body: Some(json!("created user: BIG_BEN")), - etc: Some(json!({})), + body: Some(json!("created user: BIG_BEN")), + etc: Some(json!({})), validation: None, - status: 200, + status: 200, }; let mut register = Register::default(); let params = Params::default();