mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fix some "unnecessary parentheses" warnings
This commit is contained in:
parent
6e3fba97bd
commit
897a5b39c5
8 changed files with 9 additions and 9 deletions
|
@ -548,7 +548,7 @@ impl SizeConstraint {
|
|||
max_size = max_size.map(|x| max(x, min_size));
|
||||
|
||||
if let Some(border) = border {
|
||||
min_size = max((min_size - border), Au(0));
|
||||
min_size = max(min_size - border, Au(0));
|
||||
max_size = max_size.map(|x| max(x - border, Au(0)));
|
||||
}
|
||||
|
||||
|
|
|
@ -868,7 +868,7 @@ pub fn process_node_overflow_request<N: LayoutNode>(requested_node: N) -> NodeOv
|
|||
let style = &*layout_node.as_element().unwrap().resolved_style();
|
||||
let style_box = style.get_box();
|
||||
|
||||
NodeOverflowResponse(Some((Point2D::new(style_box.overflow_x, style_box.overflow_y))))
|
||||
NodeOverflowResponse(Some(Point2D::new(style_box.overflow_x, style_box.overflow_y)))
|
||||
}
|
||||
|
||||
pub fn process_margin_style_query<N: LayoutNode>(requested_node: N)
|
||||
|
|
|
@ -103,7 +103,7 @@ impl CSSRuleList {
|
|||
let parent_stylesheet = &*self.parent_stylesheet;
|
||||
let dom_rule = CSSRule::new_specific(&window, parent_stylesheet, new_rule);
|
||||
self.dom_rules.borrow_mut().insert(index, MutNullableDom::new(Some(&*dom_rule)));
|
||||
Ok((idx))
|
||||
Ok(idx)
|
||||
}
|
||||
|
||||
// In case of a keyframe rule, index must be valid.
|
||||
|
|
|
@ -106,7 +106,7 @@ impl PerformanceObserverMethods for PerformanceObserver {
|
|||
// step 2
|
||||
// There must be at least one valid entry type.
|
||||
if entry_types.is_empty() {
|
||||
return Err((Error::Type("entryTypes cannot be empty".to_string())));
|
||||
return Err(Error::Type("entryTypes cannot be empty".to_string()));
|
||||
}
|
||||
|
||||
// step 3-4-5
|
||||
|
|
|
@ -39,14 +39,14 @@ impl Screen {
|
|||
let (send, recv) = ipc::channel::<(Size2D<u32>)>().unwrap();
|
||||
self.window.upcast::<GlobalScope>()
|
||||
.script_to_constellation_chan().send(ScriptMsg::GetScreenSize(send)).unwrap();
|
||||
recv.recv().unwrap_or((Size2D::zero()))
|
||||
recv.recv().unwrap_or(Size2D::zero())
|
||||
}
|
||||
|
||||
fn screen_avail_size(&self) -> Size2D<u32> {
|
||||
let (send, recv) = ipc::channel::<(Size2D<u32>)>().unwrap();
|
||||
self.window.upcast::<GlobalScope>()
|
||||
.script_to_constellation_chan().send(ScriptMsg::GetScreenAvailSize(send)).unwrap();
|
||||
recv.recv().unwrap_or((Size2D::zero()))
|
||||
recv.recv().unwrap_or(Size2D::zero())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue