Skip to content

Commit 9dd7c2f

Browse files
committed
Merge pull request chris-morgan#63 from Rust-Skane/master
Make test_utils.rs work with latest Rust
2 parents 13b95c7 + d60fa7a commit 9dd7c2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/http/headers/test_utils.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::io::{MemReader, MemWriter};
22
use std::str;
3+
use std::fmt;
34
use headers::{HeaderConvertible, HeaderValueByteIterator};
45

56
pub fn from_stream_with_str<T: HeaderConvertible>(s: &str) -> Option<T> {
@@ -18,14 +19,14 @@ pub fn to_stream_into_str<T: HeaderConvertible>(v: &T) -> ~str {
1819

1920
// Verify that a value cannot be successfully interpreted as a header value of the specified type.
2021
#[inline]
21-
pub fn assert_invalid<T: HeaderConvertible>(string: &str) {
22+
pub fn assert_invalid<T: HeaderConvertible + fmt::Show>(string: &str) {
2223
assert_eq!(from_stream_with_str::<T>(string), None);
2324
}
2425

2526
// Verify that all of the methods from the HeaderConvertible trait work correctly for the given
2627
// valid header value and correct decoded value.
2728
#[inline]
28-
pub fn assert_conversion_correct<T: HeaderConvertible>(string: &'static str, value: T) {
29+
pub fn assert_conversion_correct<T: HeaderConvertible + fmt::Show>(string: &'static str, value: T) {
2930
assert_eq!(from_stream_with_str(string), Some(value.clone()));
3031
let s = to_stream_into_str(&value);
3132
assert_eq!(s.as_slice(), string);
@@ -35,6 +36,6 @@ pub fn assert_conversion_correct<T: HeaderConvertible>(string: &'static str, val
3536

3637
// Verify that from_stream interprets the given valid header value correctly.
3738
#[inline]
38-
pub fn assert_interpretation_correct<T: HeaderConvertible>(string: &'static str, value: T) {
39+
pub fn assert_interpretation_correct<T: HeaderConvertible + fmt::Show>(string: &'static str, value: T) {
3940
assert_eq!(from_stream_with_str(string), Some(value));
4041
}

0 commit comments

Comments
 (0)