Skip to content

Commit

Permalink
Rename PlateformSpecific variant in Action to Custom
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 3, 2024
1 parent 6e97595 commit 2656906
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions runtime/src/command/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ pub enum Action<T> {
tagger: Box<dyn Fn(Result<(), font::Error>) -> T>,
},

/// Pass PlatformSpecific action, for some special platform
PlatformSpecific(Box<dyn Any>)
/// A custom action supported by a specific runtime.
Custom(Box<dyn Any>),
}

impl<T> Action<T> {
Expand Down Expand Up @@ -76,7 +76,7 @@ impl<T> Action<T> {
bytes,
tagger: Box::new(move |result| f(tagger(result))),
},
Self::PlatformSpecific(special) => Action::PlatformSpecific(special)
Self::Custom(custom) => Action::Custom(custom),
}
}
}
Expand All @@ -95,7 +95,7 @@ impl<T> fmt::Debug for Action<T> {
Self::System(action) => write!(f, "Action::System({action:?})"),
Self::Widget(_action) => write!(f, "Action::Widget"),
Self::LoadFont { .. } => write!(f, "Action::LoadFont"),
Self::PlatformSpecific(_) => write!(f, "Action::PlatformSpecific")
Self::Custom(_) => write!(f, "Action::Custom"),
}
}
}
4 changes: 3 additions & 1 deletion winit/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,9 @@ pub fn run_command<A, C, E>(
.send_event(tagger(Ok(())))
.expect("Send message to event loop");
}
command::Action::PlatformSpecific(_) => unimplemented!(),
command::Action::Custom(_) => {
log::warn!("Unsupported custom action in `iced_winit` shell");
}
}
}
}
3 changes: 3 additions & 0 deletions winit/src/multi_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,9 @@ fn run_command<A, C, E>(
.send_event(tagger(Ok(())))
.expect("Send message to event loop");
}
command::Action::Custom(_) => {
log::warn!("Unsupported custom action in `iced_winit` shell");
}
}
}
}
Expand Down

0 comments on commit 2656906

Please sign in to comment.