Is there any way to cancel the <bool> option?

I came across a provided function that takes a parameter Into<Option<bool>>as a parameter, but I want to pass the opposite value of my current bool to it.

+4
source share
1 answer

Have you tried opt.map(|b| !b)?

+10
source

Source: https://habr.com/ru/post/1686775/


All Articles