Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi authored Oct 18, 2024
1 parent 0bcbe3b commit a5b5267
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lints/enum_variant_missing.ron
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ SemverQuery(
error_message: "A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.",
per_result_error_template: Some("variant {{enum_name}}::{{variant_name}}, previously in file {{span_filename}}:{{span_begin_line}}"),
witness: (
hint_template: r#"let witness = {{join "::" path}}::{{variant_name}}{{#if (eq kind "StructVariant")}}{...}{{/if}}{{#if (eq kind "TupleVariant")}}(...){{/if}};"#,
hint_template: r#"let witness = {{join "::" path}}::{{variant_name}}{{#if (eq kind "StructVariant")}} {...}{{/if}}{{#if (eq kind "TupleVariant")}}(...){{/if}};"#,
),
)
2 changes: 1 addition & 1 deletion test_crates/enum_variant_missing/old/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum TupleVariantWillBeRemoved {
pub enum StructVariantWillBeRemoved {
Foo { bar: usize },
/// Testing: <https://doc.rust-lang.org/cargo/reference/semver.html#item-remove>
Bar{ bar: usize },
Bar { bar: usize },
}

/// This enum should not be reported by the `enum_variant_missing` rule:
Expand Down
2 changes: 1 addition & 1 deletion test_outputs/witnesses/enum_variant_missing.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ hint = 'let witness = enum_variant_missing::TupleVariantWillBeRemoved::Bar(...);
[["./test_crates/enum_variant_missing/"]]
filename = 'src/lib.rs'
begin_line = 16
hint = 'let witness = enum_variant_missing::StructVariantWillBeRemoved::Bar{...};'
hint = 'let witness = enum_variant_missing::StructVariantWillBeRemoved::Bar {...};'

0 comments on commit a5b5267

Please sign in to comment.