atom icon indicating copy to clipboard operation
atom copied to clipboard

AtomSetOnce incomplete documentation

Open garfieldnate opened this issue 4 years ago • 1 comments

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.

garfieldnate avatar Mar 04 '20 20:03 garfieldnate

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.

jonathanGB avatar Jul 25 '22 02:07 jonathanGB