Skip to content

Commit 49b6974

Browse files
committed
fix(versioned): Consitently use .into() in enum variant From impls
1 parent 5ff7d2e commit 49b6974

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

crates/stackable-versioned-macros/src/codegen/item/variant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl VersionedVariant {
164164
}),
165165
Direction::Downgrade => Some(quote! {
166166
#next_version_ident::#enum_ident::#next_variant_ident #from_fields
167-
=> #old_version_ident::#enum_ident::#old_variant_ident #from_fields,
167+
=> #old_version_ident::#enum_ident::#old_variant_ident #for_fields,
168168
}),
169169
}
170170
}

crates/stackable-versioned-macros/tests/inputs/pass/enum_fields.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ use stackable_versioned::versioned;
44
// ---
55
pub mod versioned {
66
enum Foo {
7-
A { aa: usize, aaa: u64 },
8-
B { bb: bool },
7+
#[versioned(changed(since = "v1alpha2", from_name = "PrevA"))]
8+
A {
9+
aa: usize,
10+
aaa: u64,
11+
},
12+
B {
13+
bb: bool,
14+
},
915
}
1016

1117
enum Bar {
18+
#[versioned(changed(since = "v1alpha2", from_name = "PrevA"))]
1219
A(A),
1320
B {},
1421
}

crates/stackable-versioned-macros/tests/snapshots/stackable_versioned_macros__snapshots__pass@enum_fields.rs.snap

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)