Re: [PATCH v4] rust: sync: add #[must_use] to Lock::try_lock

Miguel Ojeda
2024-12-11T09:45:52Z

On Wed, Dec 11, 2024 at 3:05 AM Jason Devers <dev.json2@gmail.com> wrote:
>
> + /// Note that `T` is `#[must_use]` but `Option<T>` is not.

Should this be a comment, i.e. `//`, rather than part of the documentation?

I would also reword to explain the "what", not just "why", e.g. something like:

// `Option<T>` is not `#[must_use]` even if `T` is, thus the
attribute is needed here.

Cheers,
Miguel