Re: [PATCH 2/3] rust: net: phy: make example buildable
From: FUJITA Tomonori
Date: Tue Nov 11 2025 - 17:55:50 EST
On Tue, 11 Nov 2025 22:02:26 +0100
Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>> I think that some code begin lines with # for use lines in a "#
>> Examples" section, while others do not. Which style is recommended?
>
> There is no hard rule for all cases -- we typically hide things that
> are not important for the example (e.g. fake `mod bindings` that are
> used to support the example but aren't important and would bloat the
> example or confuse the reader).
>
> For imports, some people prefer to see them, others don't. Here, for
> instance, it may be interesting to show the paths (e.g. that the
> `Device` is a `net::phy::` one, or where `C22` is coming from), so we
> could unhide it. So up to you!
>
> So I think the rule is really: if it is something that we think people
> should see to actually understand the example, then we should show it.
>
> And if it is something that would confuse them more than help, or that
> generally should not be used in real code (like the fake bindings),
> then we should hide it.
Understood, thanks!
Then I don't think that the imports in this example are important so
please add:
Reviewed-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>