Skip to content

Commit c8f016f

Browse files
committed
Fix reversed suggestion on postfix
1 parent 8ed723b commit c8f016f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clippy_lints/src/enum_variants.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ fn check_variant(cx: &LateContext<'_>, threshold: u64, def: &EnumDef<'_>, item_n
185185
let (what, value) = match (pre.is_empty(), post.is_empty()) {
186186
(true, true) => return,
187187
(false, _) => ("pre", pre.join("")),
188-
(true, false) => ("post", post.join("")),
188+
(true, false) => {
189+
post.reverse();
190+
("post", post.join(""))
191+
},
189192
};
190193
span_lint_and_help(
191194
cx,

tests/ui/enum_variants.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ LL | | }
9696
|
9797
= help: remove the prefixes and use full paths to the variants instead of glob imports
9898

99-
error: all variants have the same postfix: `DataI`
99+
error: all variants have the same postfix: `IData`
100100
--> $DIR/enum_variants.rs:136:1
101101
|
102102
LL | / enum IDataRequest {
@@ -108,7 +108,7 @@ LL | | }
108108
|
109109
= help: remove the postfixes and use full paths to the variants instead of glob imports
110110

111-
error: all variants have the same postfix: `DataIH`
111+
error: all variants have the same postfix: `HIData`
112112
--> $DIR/enum_variants.rs:142:1
113113
|
114114
LL | / enum HIDataRequest {

0 commit comments

Comments
 (0)