mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
clippy: Fix warnings in components/shared
(#31627)
* clippy: fix warnings in `components/shared` * fix: formatting derive * fix: rename new to default
This commit is contained in:
parent
4efebf1e62
commit
21939c2ba8
11 changed files with 36 additions and 50 deletions
|
@ -131,7 +131,7 @@ impl ScrollTreeNode {
|
|||
|
||||
let scrollable_width = info.scrollable_size.width;
|
||||
let scrollable_height = info.scrollable_size.height;
|
||||
let original_layer_scroll_offset = info.offset.clone();
|
||||
let original_layer_scroll_offset = info.offset;
|
||||
|
||||
if scrollable_width > 0. {
|
||||
info.offset.x = (info.offset.x + delta.x).min(0.0).max(-scrollable_width);
|
||||
|
@ -172,10 +172,10 @@ impl ScrollTree {
|
|||
parent: parent.cloned(),
|
||||
scroll_info,
|
||||
});
|
||||
return ScrollTreeNodeId {
|
||||
ScrollTreeNodeId {
|
||||
index: self.nodes.len() - 1,
|
||||
spatial_id,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a mutable reference to the node with the given index.
|
||||
|
@ -198,7 +198,7 @@ impl ScrollTree {
|
|||
scroll_location: ScrollLocation,
|
||||
) -> Option<(ExternalScrollId, LayoutVector2D)> {
|
||||
let parent = {
|
||||
let ref mut node = self.get_node_mut(scroll_node_id);
|
||||
let node = &mut self.get_node_mut(scroll_node_id);
|
||||
let result = node.scroll(scroll_location);
|
||||
if result.is_some() {
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue