Thread (63 messages) 63 messages, 5 authors, 2025-01-24

Re: [PATCH v8 2/7] rust: time: Introduce Delta type

From: Miguel Ojeda <hidden>
Date: 2025-01-22 08:57:53
Also in: lkml, rust-for-linux

On Wed, Jan 22, 2025 at 8:37 AM FUJITA Tomonori
[off-list ref] wrote:
Yes, please create such. I'll add more docs but I'm sure that there
will be room for improvement.
Sounds good, will do!
You want to add the above explanation to all the
Delta::from_[millis|micro|secs], right?
Yeah, I meant to add the saturating note to each of them.
Is there any existing source code I can refer to? I'm not sure
how "module-level docs" should be written.
You can see e.g.

    rust/kernel/block/mq.rs
    rust/kernel/init.rs
    rust/kernel/workqueue.rs

(grep `^//!` for others).

In general, you can use the module-level docs to talk about how things
relate between items of that module. For instance, when I saw in your
commit message this note:

    Implement the subtraction operator for Instant:

    Delta = Instant A - Instant B

I thought something like: "It would be nice to explain how `Delta` and
`Instant` fit together / how they are related / how all fits together
in the `time` module".
I'll try to improve.
Thanks a lot! (really -- I personally appreciate good docs)

Cheers,
Miguel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help