Sorry, the actual point I failed to emphasize was that if you have a function with generic type T: Into<u64>, you can just pass in a u64, as the conversion is trivial to write caller-side (b as u64). The use of as is almost beside the point, but it’s easier to defend in this case since the conversion is not lossy. A clearer alternative might be to make a more descriptive helper method or inline its trivial implementation:
fn one_if_true(b: bool): u64 { if b {1} else {0} }
...
do_something(one_if_true(true));
do_something(if b {1} else {0});
Generally, an implementation of Into is useful when the intended conversion is obvious (and especially so if its implementation is non-trivial). I agree with @DanielKeep’s original comment: mathematically speaking, there’s not an obvious canonical choice for conversion from bool, although some languages have settled on false/true -> 0/1.
This example has no constraints on T at all, making v unusable within the body. My point is, if you have T: Into<u64> on the method, just pass in u64 by doing an explicit conversion client-side as that’s trivial for bools given a choice of numbers for true and false.