take_mut icon indicating copy to clipboard operation
take_mut copied to clipboard

Take no exit

Open Kixunil opened this issue 7 years ago • 4 comments

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

Kixunil avatar May 07 '17 19:05 Kixunil

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

Sgeo avatar May 07 '17 19:05 Sgeo

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 avatar May 07 '17 21:05 Kixunil

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

Kixunil avatar May 07 '17 21:05 Kixunil

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

Kixunil avatar May 07 '17 21:05 Kixunil