Use `== 0` instead of `as bool`

Fixes compilation using current rust master (510c4d8dcf7).