Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit bc47859

Browse files
committed
Change WriterUtil to use default methods.
1 parent 04a35d6 commit bc47859

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/http/headers/serialization_utils.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,7 @@ pub fn comma_split_iter<'a>(value: &'a str)
5454
value.split(',').map(|w| w.trim_left())
5555
}
5656

57-
pub trait WriterUtil {
58-
fn write_maybe_quoted_string(&mut self, s: &str);
59-
fn write_quoted_string(&mut self, s: &str);
60-
fn write_parameter(&mut self, k: &str, v: &str);
61-
// TODO: &Str instead of ~str?
62-
fn write_parameters(&mut self, parameters: &[(~str, ~str)]);
63-
fn write_quality(&mut self, quality: Option<f64>);
64-
fn write_token(&mut self, token: &str);
65-
}
66-
67-
impl<W: Writer> WriterUtil for W {
57+
pub trait WriterUtil: Writer {
6858
fn write_maybe_quoted_string(&mut self, s: &str) {
6959
if is_token(s) {
7060
self.write(s.as_bytes());
@@ -118,6 +108,8 @@ impl<W: Writer> WriterUtil for W {
118108
}
119109
}
120110

111+
impl<W: Writer> WriterUtil for W { }
112+
121113
/// Join a vector of values with commas, as is common for HTTP headers.
122114
///
123115
/// # Examples

0 commit comments

Comments
 (0)