aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/constellation/constellation.rs4
-rw-r--r--components/layout/fragment.rs4
-rw-r--r--components/script/dom/bindings/mozmap.rs4
-rw-r--r--components/script/dom/element.rs15
-rw-r--r--components/script_plugins/unrooted_must_root.rs5
-rw-r--r--components/selectors/parser.rs5
-rw-r--r--components/style/values/specified/calc.rs12
-rw-r--r--components/style/values/specified/color.rs5
-rw-r--r--components/style/values/specified/length.rs4
-rw-r--r--components/style/values/specified/time.rs5
10 files changed, 42 insertions, 21 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs
index 17918cb13a0..2b6df7d456a 100644
--- a/components/constellation/constellation.rs
+++ b/components/constellation/constellation.rs
@@ -3127,7 +3127,9 @@ where
let control_msg = ConstellationControlMsg::WebDriverScriptCommand(pipeline_id, cmd);
let result = match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline.event_loop.send(control_msg),
- None => return warn!("Pipeline {:?} ScriptCommand after closure.", pipeline_id),
+ None => {
+ return warn!("Pipeline {:?} ScriptCommand after closure.", pipeline_id)
+ },
};
if let Err(e) = result {
self.handle_send_error(pipeline_id, e);
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 2511b5ea868..d8183eae1c9 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -1658,7 +1658,9 @@ impl Fragment {
handle_text(text_fragment_info, self, &mut result)
},
- SpecificFragmentInfo::TruncatedFragment(_) => return IntrinsicISizesContribution::new(),
+ SpecificFragmentInfo::TruncatedFragment(_) => {
+ return IntrinsicISizesContribution::new()
+ },
SpecificFragmentInfo::UnscannedText(..) => {
panic!("Unscanned text fragments should have been scanned by now!")
diff --git a/components/script/dom/bindings/mozmap.rs b/components/script/dom/bindings/mozmap.rs
index db46debc58e..f5961e5bdda 100644
--- a/components/script/dom/bindings/mozmap.rs
+++ b/components/script/dom/bindings/mozmap.rs
@@ -93,7 +93,9 @@ where
let property = match T::from_jsval(cx, property.handle(), config.clone())? {
ConversionResult::Success(property) => property,
- ConversionResult::Failure(message) => return Ok(ConversionResult::Failure(message)),
+ ConversionResult::Failure(message) => {
+ return Ok(ConversionResult::Failure(message))
+ },
};
// TODO: Is this guaranteed to succeed?
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 4321540676b..04474480027 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -2533,13 +2533,14 @@ impl ElementMethods for Element {
let position = position.parse::<AdjacentPosition>()?;
let context = match position {
- AdjacentPosition::BeforeBegin | AdjacentPosition::AfterEnd => match self
- .upcast::<Node>()
- .GetParentNode()
- {
- Some(ref node) if node.is::<Document>() => return Err(Error::NoModificationAllowed),
- None => return Err(Error::NoModificationAllowed),
- Some(node) => node,
+ AdjacentPosition::BeforeBegin | AdjacentPosition::AfterEnd => {
+ match self.upcast::<Node>().GetParentNode() {
+ Some(ref node) if node.is::<Document>() => {
+ return Err(Error::NoModificationAllowed)
+ },
+ None => return Err(Error::NoModificationAllowed),
+ Some(node) => node,
+ }
},
AdjacentPosition::AfterBegin | AdjacentPosition::BeforeEnd => {
DomRoot::from_ref(self.upcast::<Node>())
diff --git a/components/script_plugins/unrooted_must_root.rs b/components/script_plugins/unrooted_must_root.rs
index 1f05539490c..c4694b5e56a 100644
--- a/components/script_plugins/unrooted_must_root.rs
+++ b/components/script_plugins/unrooted_must_root.rs
@@ -121,7 +121,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
) {
let item = match cx.tcx.hir().get_by_hir_id(id) {
hir::Node::Item(item) => item,
- _ => cx.tcx.hir().expect_item_by_hir_id(cx.tcx.hir().get_parent_item(id)),
+ _ => cx
+ .tcx
+ .hir()
+ .expect_item_by_hir_id(cx.tcx.hir().get_parent_item(id)),
};
if item.attrs.iter().all(|a| !a.check_name("must_root")) {
for ref field in def.fields() {
diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs
index fa043b772a9..488628cd712 100644
--- a/components/selectors/parser.rs
+++ b/components/selectors/parser.rs
@@ -1959,8 +1959,9 @@ where
let name = match input.next_including_whitespace()? {
&Token::Ident(ref name) => name.clone(),
t => {
- return Err(location
- .new_custom_error(SelectorParseErrorKind::NoIdentForPseudo(t.clone())));
+ return Err(location.new_custom_error(
+ SelectorParseErrorKind::NoIdentForPseudo(t.clone()),
+ ));
},
};
diff --git a/components/style/values/specified/calc.rs b/components/style/values/specified/calc.rs
index 9e66edd9a9e..48389ce5782 100644
--- a/components/style/values/specified/calc.rs
+++ b/components/style/values/specified/calc.rs
@@ -180,7 +180,9 @@ impl CalcNode {
) => {
return NoCalcLength::parse_dimension(context, value, unit)
.map(CalcNode::Length)
- .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+ .map_err(|()| {
+ location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+ });
},
(
&Token::Dimension {
@@ -190,7 +192,9 @@ impl CalcNode {
) => {
return Angle::parse_dimension(value, unit, /* from_calc = */ true)
.map(CalcNode::Angle)
- .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+ .map_err(|()| {
+ location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+ });
},
(
&Token::Dimension {
@@ -200,7 +204,9 @@ impl CalcNode {
) => {
return Time::parse_dimension(value, unit, /* from_calc = */ true)
.map(CalcNode::Time)
- .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+ .map_err(|()| {
+ location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+ });
},
(&Token::Percentage { unit_value, .. }, CalcUnit::LengthPercentage) |
(&Token::Percentage { unit_value, .. }, CalcUnit::Percentage) => {
diff --git a/components/style/values/specified/color.rs b/components/style/values/specified/color.rs
index 2ee159987f8..7a42e834236 100644
--- a/components/style/values/specified/color.rs
+++ b/components/style/values/specified/color.rs
@@ -274,8 +274,9 @@ impl Color {
if ident.len() != 3 && ident.len() != 6 {
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
}
- return parse_hash_color(ident.as_bytes())
- .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+ return parse_hash_color(ident.as_bytes()).map_err(|()| {
+ location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+ });
},
ref t => {
return Err(location.new_unexpected_token_error(t.clone()));
diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs
index a8cae981993..ffdd8d026ef 100644
--- a/components/style/values/specified/length.rs
+++ b/components/style/values/specified/length.rs
@@ -614,7 +614,9 @@ impl Length {
!context.parsing_mode.allows_unitless_lengths() &&
!allow_quirks.allowed(context.quirks_mode)
{
- return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+ return Err(
+ location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+ );
}
return Ok(Length::NoCalc(NoCalcLength::Absolute(AbsoluteLength::Px(
value,
diff --git a/components/style/values/specified/time.rs b/components/style/values/specified/time.rs
index 740232f5cbc..9f2aa6f3580 100644
--- a/components/style/values/specified/time.rs
+++ b/components/style/values/specified/time.rs
@@ -93,8 +93,9 @@ impl Time {
Ok(&Token::Dimension {
value, ref unit, ..
}) if clamping_mode.is_ok(ParsingMode::DEFAULT, value) => {
- return Time::parse_dimension(value, unit, /* from_calc = */ false)
- .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+ return Time::parse_dimension(value, unit, /* from_calc = */ false).map_err(|()| {
+ location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+ });
},
Ok(&Token::Function(ref name)) if name.eq_ignore_ascii_case("calc") => {},
Ok(t) => return Err(location.new_unexpected_token_error(t.clone())),