2026-03-23 21:06 UTC
Replies (2)
-
@diondokter@fosstodon.org 2026-03-23 21:08
@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...
-
@epage@hachyderm.io 2026-03-23 21:12
@diondokter > https://epage.github.io/dev/rust-style/#m-pub-priv > I generally agree with it. But it is possible for a private type to be more relevant to user understanding than another public type and thus warrants being put above it. Note that M-CALLER-CALLEE goes before it and calls out: "The weaker the abstraction of the callee, the more immediately after the caller it should be." I assume that covers your situation? > https://epage.github.io/dev/rust-style/#m-assoc-trait > Sometimes a trait impl is more important than seeing the functions. Probably not true for normal trait impls like Clone or Display. Definitely put those last yeah That guideline provides some important context for it: "Typically, associated functions form the core API for a type and trait implementations augment that API." Sounds like you are dealing with exception cases. That said, I can only think of a couple of places where I intentionally do not follow this guideline.