Untry style

This commit is contained in:
Simon Sapin 2017-06-18 12:40:03 +02:00
parent 4c5f7bfaa3
commit a5bb55790f
45 changed files with 518 additions and 527 deletions

View file

@ -230,7 +230,7 @@ impl Resolution {
}
fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
let (value, unit) = match try!(input.next()) {
let (value, unit) = match input.next()? {
Token::Dimension { value, unit, .. } => {
(value, unit)
},
@ -462,9 +462,9 @@ impl Expression {
/// ```
pub fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
-> Result<Self, ParseError<'i>> {
try!(input.expect_parenthesis_block());
input.expect_parenthesis_block()?;
input.parse_nested_block(|input| {
let ident = try!(input.expect_ident());
let ident = input.expect_ident()?;
let mut flags = 0;
let result = {

View file

@ -407,9 +407,9 @@ pub struct GeckoElement<'le>(pub &'le RawGeckoElement);
impl<'le> fmt::Debug for GeckoElement<'le> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "<{}", self.get_local_name()));
write!(f, "<{}", self.get_local_name())?;
if let Some(id) = self.get_id() {
try!(write!(f, " id={}", id));
write!(f, " id={}", id)?;
}
let mut first = true;