You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think a good point is being raised here. I am not sure whether the documentation changed in the meantime, or whether I missed something last time. However, we could update the comment with new argumentation following the current requirements for volatile reads:
IIUC it's bad to mix volatile and non-volatile operations.
The current implementation seems to be built on a non-volatile read (to load the user-provided u8) but does not make any use of volatile writes.
It seems like it would be better to use volatile_write to write the value to the Choice, and volatile_read to retrieve it, making Choice something of a VolatileCell type, although even that doesn't provide a proper abstraction when used with references, and without Pin it may change locations with moves.
subtle/src/lib.rs
Line 223 in b4b070c
The text was updated successfully, but these errors were encountered: