Skip to content

Commit 440ce90

Browse files
committed
Pass BarHoveredState by value & and impl Default for ScrollComponent
1 parent 803ab74 commit 440ce90

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

druid/src/scroll_component.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub enum BarHoveredState {
3333
}
3434

3535
impl BarHoveredState {
36-
pub fn is_hovered(&self) -> bool {
36+
pub fn is_hovered(self) -> bool {
3737
match self {
3838
BarHoveredState::Vertical | BarHoveredState::Horizontal => true,
3939
_ => false,
@@ -88,6 +88,12 @@ pub struct ScrollComponent {
8888
pub scrollbars: ScrollbarsState,
8989
}
9090

91+
impl Default for ScrollComponent {
92+
fn default() -> Self {
93+
ScrollComponent::new()
94+
}
95+
}
96+
9197
impl ScrollComponent {
9298
pub fn new() -> ScrollComponent {
9399
ScrollComponent {

0 commit comments

Comments
 (0)