Line | Count | Source |
1 | use std::fmt::Display; | |
2 | ||
3 | use http::HeaderValue; | |
4 | ||
5 | 0 | pub(crate) fn fmt<T: Display>(fmt: T) -> HeaderValue { |
6 | 0 | let s = fmt.to_string(); |
7 | 0 | match HeaderValue::from_maybe_shared(s) { |
8 | 0 | Ok(val) => val, |
9 | 0 | Err(err) => panic!("illegal HeaderValue; error = {:?}, fmt = \"{}\"", err, fmt), |
10 | } | |
11 | 0 | } |