Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tov
Copy link
Collaborator

@tov tov commented Dec 20, 2021

We check that we can call a ClosureOnce once successfully, but calling it a second time is an error. Normally if this error occurs, the program exits (code 2), because it isn’t safe to panic when calling an FFI callback. However, in cfg(test) this error instead causes a panic, so that we can test the error using #[should_panic].

We check that we can call a ClosureOnce once successfully,
but it’s an error to call it twice. Normally if this error
occurs, the program exits (code 2), because it isn’t
safe to panic when calling a callback. However, in
cfg(test) this error results in a panic so that we can
test the error using #[should_panic].
@tov tov marked this pull request as draft December 20, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant