This is not very nice:
let authz = BasicAuth::new("any", &api_key);
let res = client.put(&path)
.header(authz.name(), authz.value())
(From https://github.com/squamishaccess/squamishaccess-signup-function-rs/blob/6c445916760a4db21da80c732fbe8e9c704c1bd1/src/main.rs#L168-L172)
I think something like ToHeaderPair may be ideal? We could implement that for a tuple and for typed headers.
let authz = BasicAuth::new("any", &api_key);
let res = client.put(&path)
.header(authz)
// OR
.header((authz.name(), authz.value()))
This would be different than ToHeaderValues since it would also have the header name.
@yoshuawuyts thoughts?