Skip to content

Take no exit#4

Open
Kixunil wants to merge 5 commits into
Sgeo:masterfrom
Kixunil:take_no_exit
Open

Take no exit#4
Kixunil wants to merge 5 commits into
Sgeo:masterfrom
Kixunil:take_no_exit

Conversation

@Kixunil

@Kixunil Kixunil commented May 7, 2017

Copy link
Copy Markdown

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

@Sgeo

Sgeo commented May 7, 2017

Copy link
Copy Markdown
Owner

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

@Kixunil

Kixunil commented May 7, 2017

Copy link
Copy Markdown
Author

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

Kixunil commented May 7, 2017

Copy link
Copy Markdown
Author

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

@Kixunil

Kixunil commented May 7, 2017

Copy link
Copy Markdown
Author

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