Supposing I have a function like this:
fn my<T: fmt::Debug, U>(x: T) {
println!("{:?}", mem::size_of::<U>());
println!("{:?}", x);
}
It depends on two types T and U. I have to specify the type U when I call the function my. On the other hand, the type T can be determined from passed x, so, it's logical, I can miss it in a call.
When I try:
my::<u8>(10);
I get the error:
error[E0107]: wrong number of type arguments: expected 2, found 1
What is the correct way to say to Rust compiler to get the type T from passed x and to pass U only in <...>?