Remove uses of parse_four_sides and serialize_four_sides

This commit is contained in:
Anthony Ramine 2017-05-25 12:22:49 +02:00
parent ca8fae91da
commit 6f3c46ca61
6 changed files with 41 additions and 141 deletions

View file

@ -6,57 +6,6 @@ use style_traits::ToCss;
use values::specified::{BorderStyle, Color, CSSColor};
use std::fmt;
#[allow(missing_docs)]
pub fn serialize_four_sides<W, I>(dest: &mut W,
top: &I,
right: &I,
bottom: &I,
left: &I)
-> fmt::Result
where W: fmt::Write,
I: ToCss + PartialEq,
{
if left == right {
let horizontal_value = left;
if top == bottom {
let vertical_value = top;
if horizontal_value == vertical_value {
let single_value = horizontal_value;
try!(single_value.to_css(dest));
} else {
try!(vertical_value.to_css(dest));
try!(write!(dest, " "));
try!(horizontal_value.to_css(dest));
}
} else {
try!(top.to_css(dest));
try!(write!(dest, " "));
try!(horizontal_value.to_css(dest));
try!(write!(dest, " "));
try!(bottom.to_css(dest));
}
} else {
try!(top.to_css(dest));
try!(write!(dest, " "));
try!(right.to_css(dest));
try!(write!(dest, " "));
try!(bottom.to_css(dest));
try!(write!(dest, " "));
try!(left.to_css(dest));
}
Ok(())
}
fn serialize_directional_border<W, I,>(dest: &mut W,
width: &I,
style: &BorderStyle,