Add [cast_to_bool] and factorise "if" rules.

1 job for master in 14 minutes and 33 seconds (queued for 2 seconds)