rust - Unable to create hyper::Client because the compiler cannot infer enough type information -
to experiment hyper, started the example. aside fact example doesn't compile (no method `get` in `client`
) have distilled problem single line:
fn temp() { let client = client::new(); }
this code won't compile:
unable infer enough type information `_`; type annotations or generic parameter binding required [e0282]
in general error mean client
has generic parameter , compiler can not infer it's value. have tell somehow.
here example std::vec::vec
:
use std::vec::vec; fn problem() { let v = vec::new(); // problem, vec<???> want? } fn solution_1() { let mut v = vec::<i32>::new(); // tell compiler directly } fn solution_2() { let mut v: vec<i32> = vec::new(); // tell compiler specifying type } fn solution_3() { let mut v = vec::new(); v.push(1); // tell compiler using }
but hyper::client::client
doesn't have generic parameters. sure client
trying instantiate 1 hyper?
Comments
Post a Comment