From 9cadf0981a6ff856dd58bea24a99dd4a79dfccd9 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 20 Oct 2017 09:11:38 -0700 Subject: [PATCH] Remove unnecessary Result::ok calls --- components/script/dom/promise.rs | 2 +- components/style/values/specified/basic_shape.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/script/dom/promise.rs b/components/script/dom/promise.rs index ad8ee2adfeb..df9838ed5cc 100644 --- a/components/script/dom/promise.rs +++ b/components/script/dom/promise.rs @@ -246,7 +246,7 @@ unsafe extern fn native_handler_callback(cx: *mut JSContext, argc: u32, vp: *mut assert!(v.get().is_object()); let handler = root_from_object::(v.to_object()) - .ok().expect("unexpected value for native handler in promise native handler callback"); + .expect("unexpected value for native handler in promise native handler callback"); rooted!(in(cx) let v = *GetFunctionNativeReserved(args.callee(), SLOT_NATIVEHANDLER_TASK)); match v.to_int32() { diff --git a/components/style/values/specified/basic_shape.rs b/components/style/values/specified/basic_shape.rs index 9a541ac156b..dbc63adee06 100644 --- a/components/style/values/specified/basic_shape.rs +++ b/components/style/values/specified/basic_shape.rs @@ -151,7 +151,7 @@ impl Circle { #[allow(missing_docs)] pub fn parse_function_arguments<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result> { - let radius = input.try(|i| ShapeRadius::parse(context, i)).ok().unwrap_or_default(); + let radius = input.try(|i| ShapeRadius::parse(context, i)).unwrap_or_default(); let position = if input.try(|i| i.expect_ident_matching("at")).is_ok() { Position::parse(context, input)? } else { @@ -192,7 +192,7 @@ impl Ellipse { -> Result> { let (a, b) = input.try(|i| -> Result<_, ParseError> { Ok((ShapeRadius::parse(context, i)?, ShapeRadius::parse(context, i)?)) - }).ok().unwrap_or_default(); + }).unwrap_or_default(); let position = if input.try(|i| i.expect_ident_matching("at")).is_ok() { Position::parse(context, input)? } else { @@ -319,7 +319,7 @@ impl Polygon { let fill = FillRule::parse(i)?; i.expect_comma()?; // only eat the comma if there is something before it Ok(fill) - }).ok().unwrap_or_default(); + }).unwrap_or_default(); let buf = input.parse_comma_separated(|i| { Ok((LengthOrPercentage::parse(context, i)?, LengthOrPercentage::parse(context, i)?))