style(headers): Break lines with over 100 characters

This commit is contained in:
Pyfisch
2015-05-03 15:45:11 +02:00
parent 66d54d03e7
commit db4d89189a
11 changed files with 92 additions and 35 deletions

View File

@@ -124,8 +124,16 @@ macro_rules! test_header {
let value = HeaderField::parse_header(&a[..]);
let result = format!("{}", value.unwrap());
let expected = String::from_utf8(raw[0].to_vec()).unwrap();
let result_cmp: Vec<String> = result.to_ascii_lowercase().split(' ').map(|x| x.to_string()).collect();
let expected_cmp: Vec<String> = expected.to_ascii_lowercase().split(' ').map(|x| x.to_string()).collect();
let result_cmp: Vec<String> = result
.to_ascii_lowercase()
.split(' ')
.map(|x| x.to_string())
.collect();
let expected_cmp: Vec<String> = expected
.to_ascii_lowercase()
.split(' ')
.map(|x| x.to_string())
.collect();
assert_eq!(result_cmp.concat(), expected_cmp.concat());
}
};
@@ -259,7 +267,8 @@ macro_rules! header {
fn fmt_header(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
$id::Any => f.write_str("*"),
$id::Items(ref fields) => $crate::header::parsing::fmt_comma_delimited(f, &fields[..])
$id::Items(ref fields) => $crate::header::parsing::fmt_comma_delimited(
f, &fields[..])
}
}
}