Skip to content

Commit a306e0a

Browse files
committed
Simplify several tests
1 parent 892b03b commit a306e0a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/headers/mod.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,14 @@ mod tests {
159159
const STATIC_HEADER: HeaderName = HeaderName::from_lowercase_str("hello");
160160

161161
#[test]
162-
fn test_header_name_static_non_static() {
162+
fn test_header_name_static_non_static() -> crate::Result<()> {
163163
let static_header = HeaderName::from_lowercase_str("hello");
164-
let non_static_header = HeaderName::from_str("hello").unwrap();
164+
let non_static_header = HeaderName::from_str("hello")?;
165165

166166
let mut headers = Headers::new();
167-
headers.append(STATIC_HEADER, &["foo0"][..]).unwrap();
168-
headers
169-
.append(static_header.clone(), &["foo1"][..])
170-
.unwrap();
171-
headers
172-
.append(non_static_header.clone(), &["foo2"][..])
173-
.unwrap();
167+
headers.append(STATIC_HEADER, "foo0")?;
168+
headers.append(static_header.clone(), "foo1")?;
169+
headers.append(non_static_header.clone(), "foo2")?;
174170

175171
assert_eq!(
176172
&headers.get(&STATIC_HEADER).unwrap()[..],
@@ -186,5 +182,7 @@ mod tests {
186182
&headers.get(&non_static_header).unwrap()[..],
187183
&["foo0", "foo1", "foo2",][..]
188184
);
185+
186+
Ok(())
189187
}
190188
}

0 commit comments

Comments
 (0)