perf(headers): check for header literals before allocating name

This commit is contained in:
Sean McArthur
2016-06-01 15:09:54 -07:00
parent 9338878576
commit d80d61cd78
17 changed files with 111 additions and 54 deletions

View File

@@ -55,7 +55,8 @@ pub enum IfRange {
impl Header for IfRange {
fn header_name() -> &'static str {
"If-Range"
static NAME: &'static str = "If-Range";
NAME
}
fn parse_header(raw: &[Vec<u8>]) -> ::Result<IfRange> {
let etag: ::Result<EntityTag> = header::parsing::from_one_raw_str(raw);