2026-03-23 21:08 UTC
@epage https://epage.github.io/dev/rust-style/#m-type-assoc
Enum should go under the impl bar. Now Bar is split with the enum in the middle. Feels wrong.
I think that's all...
Replies (1)
-
@epage@hachyderm.io 2026-03-23 21:15
@diondokter This is for a very particular case: you have a public type that is purely a newtype for a data-only inner type. In particular for enums, this is a technique to make your variants private. This is similar to what you said about sometimes you need the contexts of a private items to understand public items. `BarInner` exists purely for `Bar` and is that kind of context. Think of `struct Bar` and `enum BarInner` as one unit.