Skip to content

Commit 6df98ad

Browse files
author
Stephan Dilly
committed
cleanup
1 parent 603fd75 commit 6df98ad

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/components/select_branch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl DrawableComponent for SelectBranchComponent {
5353
f.size(),
5454
);
5555
let area =
56-
ui::rect_inside(&MIN_SIZE, &f.size().into(), area);
56+
ui::rect_inside(MIN_SIZE, f.size().into(), area);
5757
let area = area.intersection(rect);
5858

5959
let scroll_threshold = area.height / 3;

src/components/textinput.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ impl DrawableComponent for TextInputComponent {
202202
InputType::Multiline => {
203203
let area = ui::centered_rect(60, 20, f.size());
204204
ui::rect_inside(
205-
&Size::new(10, 3),
206-
&f.size().into(),
205+
Size::new(10, 3),
206+
f.size().into(),
207207
area,
208208
)
209209
}

src/ui/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub const fn calc_scroll_top(
2222
}
2323

2424
/// ui component size representation
25+
#[derive(Copy, Clone)]
2526
pub struct Size {
2627
pub width: u16,
2728
pub height: u16,
@@ -72,7 +73,7 @@ pub fn centered_rect(
7273
}
7374

7475
/// makes sure Rect `r` at least stays as big as min and not bigger than max
75-
pub fn rect_inside(min: &Size, max: &Size, r: Rect) -> Rect {
76+
pub fn rect_inside(min: Size, max: Size, r: Rect) -> Rect {
7677
let new_width = r.width.max(min.width).min(max.width);
7778
let new_height = r.height.max(min.height).min(max.height);
7879
let diff_width = new_width.saturating_sub(r.width);

0 commit comments

Comments
 (0)