Elektrine lite

← Feed

@epage@hachyderm.io

2026-03-23 21:15 UTC

@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.

Replies (1)

  • @diondokter@fosstodon.org 2026-03-23 21:21

    @epage yeah fair! But like I said, I'm not opposed to these guidelines. Just small disagreements and it seems like you're more relaxed about them than the writeup suggested (to me). For someone new to Rust they're good tips

    Open ##1596220