Skip to content

Commit

Permalink
Use From + typo corection
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuch committed Jan 1, 2024
1 parent 748998c commit 4a03625
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/egui/src/data/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ impl Default for CursorIcon {
}
}

impl Into<CursorIcon> for crate::ResizeDirection {
fn into(self) -> CursorIcon {
match self {
impl From<crate::ResizeDirection> for CursorIcon {
fn from(direction: crate::ResizeDirection) -> Self {
match direction {
crate::ResizeDirection::North => CursorIcon::ResizeNorth,
crate::ResizeDirection::South => CursorIcon::ResizeSouth,
crate::ResizeDirection::West => CursorIcon::ResizeWest,
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_window_frame/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn handle_resize(ui: &mut egui::Ui) -> bool {
let south_snap = (screen_rect.bottom() - pos.y).abs() <= SNAP_DIST;
let north_snap = !south_snap && (screen_rect.top() - pos.y).abs() <= SNAP_DIST;

let posible_resize_direction = match (north_snap, east_snap, west_snap, south_snap) {
let possible_resize_direction = match (north_snap, east_snap, west_snap, south_snap) {
(true, true, false, false) => Some(egui::ResizeDirection::NorthEast),
(false, true, false, true) => Some(egui::ResizeDirection::SouthEast),
(true, false, true, false) => Some(egui::ResizeDirection::NorthWest),
Expand All @@ -105,7 +105,7 @@ fn handle_resize(ui: &mut egui::Ui) -> bool {
_ => None,
};

let Some(resize_direction) = posible_resize_direction else {
let Some(resize_direction) = possible_resize_direction else {
return false;
};

Expand Down

0 comments on commit 4a03625

Please sign in to comment.