QPACK: display header field in qif line format

This commit is contained in:
stammw
2019-01-26 14:29:39 +01:00
committed by Dirkjan Ochtman
parent bc137cc8d1
commit 0e15861638
+13
View File
@@ -1,4 +1,5 @@
use std::borrow::Cow;
use std::fmt::{Display, Formatter};
/**
* https://tools.ietf.org/html/rfc7541
@@ -39,6 +40,18 @@ impl HeaderField {
}
}
impl Display for HeaderField {
fn fmt(&self, f: &mut Formatter) -> Result<(), std::fmt::Error> {
write!(
f,
"{}\t{}",
String::from_utf8_lossy(&self.name),
String::from_utf8_lossy(&self.value)
)?;
Ok(())
}
}
#[cfg(test)]
mod tests {
use super::*;