Skip to content

Commit

Permalink
Run cargo fmt with Rust 1.72
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Aug 25, 2023
1 parent 96b4354 commit 36120d5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
12 changes: 9 additions & 3 deletions tiny_skia/src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ impl Frame {
}

pub fn fill(&mut self, path: &Path, fill: impl Into<Fill>) {
let Some(path) = convert_path(path) else { return };
let Some(path) = convert_path(path) else {
return;
};
let fill = fill.into();

self.primitives
Expand All @@ -57,7 +59,9 @@ impl Frame {
size: Size,
fill: impl Into<Fill>,
) {
let Some(path) = convert_path(&Path::rectangle(top_left, size)) else { return };
let Some(path) = convert_path(&Path::rectangle(top_left, size)) else {
return;
};
let fill = fill.into();

self.primitives
Expand All @@ -73,7 +77,9 @@ impl Frame {
}

pub fn stroke<'a>(&mut self, path: &Path, stroke: impl Into<Stroke<'a>>) {
let Some(path) = convert_path(path) else { return };
let Some(path) = convert_path(path) else {
return;
};

let stroke = stroke.into();
let skia_stroke = into_stroke(&stroke);
Expand Down
12 changes: 6 additions & 6 deletions widget/src/scrollable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ pub fn update<Message>(
match event {
touch::Event::FingerPressed { .. } => {
let Some(cursor_position) = cursor.position() else {
return event::Status::Ignored
return event::Status::Ignored;
};

state.scroll_area_touched_at = Some(cursor_position);
Expand All @@ -603,7 +603,7 @@ pub fn update<Message>(
state.scroll_area_touched_at
{
let Some(cursor_position) = cursor.position() else {
return event::Status::Ignored
return event::Status::Ignored;
};

let delta = Vector::new(
Expand Down Expand Up @@ -648,7 +648,7 @@ pub fn update<Message>(
| Event::Touch(touch::Event::FingerMoved { .. }) => {
if let Some(scrollbar) = scrollbars.y {
let Some(cursor_position) = cursor.position() else {
return event::Status::Ignored
return event::Status::Ignored;
};

state.scroll_y_to(
Expand Down Expand Up @@ -678,7 +678,7 @@ pub fn update<Message>(
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
| Event::Touch(touch::Event::FingerPressed { .. }) => {
let Some(cursor_position) = cursor.position() else {
return event::Status::Ignored
return event::Status::Ignored;
};

if let (Some(scroller_grabbed_at), Some(scrollbar)) =
Expand Down Expand Up @@ -722,7 +722,7 @@ pub fn update<Message>(
Event::Mouse(mouse::Event::CursorMoved { .. })
| Event::Touch(touch::Event::FingerMoved { .. }) => {
let Some(cursor_position) = cursor.position() else {
return event::Status::Ignored
return event::Status::Ignored;
};

if let Some(scrollbar) = scrollbars.x {
Expand Down Expand Up @@ -753,7 +753,7 @@ pub fn update<Message>(
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
| Event::Touch(touch::Event::FingerPressed { .. }) => {
let Some(cursor_position) = cursor.position() else {
return event::Status::Ignored
return event::Status::Ignored;
};

if let (Some(scroller_grabbed_at), Some(scrollbar)) =
Expand Down
8 changes: 6 additions & 2 deletions widget/src/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,9 @@ where
let state = state();

if let Some(focus) = &mut state.is_focused {
let Some(on_input) = on_input else { return event::Status::Ignored };
let Some(on_input) = on_input else {
return event::Status::Ignored;
};

if state.is_pasting.is_none()
&& !state.keyboard_modifiers.command()
Expand All @@ -716,7 +718,9 @@ where
let state = state();

if let Some(focus) = &mut state.is_focused {
let Some(on_input) = on_input else { return event::Status::Ignored };
let Some(on_input) = on_input else {
return event::Status::Ignored;
};

let modifiers = state.keyboard_modifiers;
focus.updated_at = Instant::now();
Expand Down

0 comments on commit 36120d5

Please sign in to comment.