atom
atom copied to clipboard
AtomSetOnce incomplete documentation
The documentation for AtomSetOnce
stops mid-sentence with Meaning that AtomSetOnce is not usable as a
... . I would love to know how this sentence ends. The suspense is killing me! :D Seriously, though, what is AtomSetOnce not usable as? That would be pretty useful information to have.
I would also point out that the documentation for AtomSetOnce::set_if_none is incorrect:
This will do a CAS setting the value only if it is NULL this will return OK(()) if the value was written, otherwise a Err(P) will be returned, where the value was the same value that you passed into this function.
In reality, the function returns an Option<P>
, just like Atom::set_if_none. I could submit a PR with a fix to the library to actually mimic what is documented.