mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Exclude take_app from wasm32 in egui_kittest (#8178)
Otherwise `egui` won't compile for `wasm32` targets anymore. A bit odd that this was not caught in CI.
This commit is contained in:
@@ -10,6 +10,7 @@ type AppKindUi<'a> = Box<dyn FnMut(&mut egui::Ui) + 'a>;
|
|||||||
#[cfg(feature = "eframe")]
|
#[cfg(feature = "eframe")]
|
||||||
pub(crate) struct AppKindEframe<State> {
|
pub(crate) struct AppKindEframe<State> {
|
||||||
pub get_app: fn(&mut State) -> &mut dyn eframe::App,
|
pub get_app: fn(&mut State) -> &mut dyn eframe::App,
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
pub take_app: fn(State) -> Box<dyn eframe::App>,
|
pub take_app: fn(State) -> Box<dyn eframe::App>,
|
||||||
pub frame: eframe::Frame,
|
pub frame: eframe::Frame,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ impl<State> HarnessBuilder<State> {
|
|||||||
|
|
||||||
let kind = AppKind::Eframe(AppKindEframe {
|
let kind = AppKind::Eframe(AppKindEframe {
|
||||||
get_app: |state| state,
|
get_app: |state| state,
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
take_app: |state| Box::new(state),
|
take_app: |state| Box::new(state),
|
||||||
frame,
|
frame,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -711,7 +711,7 @@ impl<'a, State> Harness<'a, State> {
|
|||||||
/// Then write a `fn main()` in the test file that invokes your test directly.
|
/// Then write a `fn main()` in the test file that invokes your test directly.
|
||||||
///
|
///
|
||||||
/// See also: <https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field>
|
/// See also: <https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field>
|
||||||
#[cfg(feature = "eframe")]
|
#[cfg(all(feature = "eframe", not(target_arch = "wasm32")))]
|
||||||
#[deprecated = "Only for debugging, don't commit this."]
|
#[deprecated = "Only for debugging, don't commit this."]
|
||||||
pub fn spawn_eframe_app(self)
|
pub fn spawn_eframe_app(self)
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user