Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take no exit #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Take no exit #4

wants to merge 5 commits into from

Conversation

Kixunil
Copy link

@Kixunil Kixunil commented May 7, 2017

These changes add take_no_exit() function which uses sentinel value instead of exiting.

@Sgeo
Copy link
Owner

Sgeo commented May 7, 2017

I'm not entirely sure what the point of release_sentinel is.

@Kixunil
Copy link
Author

Kixunil commented May 7, 2017

It's optional if someone wants to implement custom handling. (i.e. logging if drop was called instead of release_sentinel or conditionally panic anyway to cause abort). It being unsafe is just optimization. impl for Option<T> doesn't use it.

@Kixunil
Copy link
Author

Kixunil commented May 7, 2017

Hmm maybe I should've provided default impl...

@Kixunil
Copy link
Author

Kixunil commented May 7, 2017

OK, I've provided default impl. Option<T> still overrides it to optimize.

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.

2 participants