not-fl3/egui-miniquad

Error E0027 when enabling AccessKit on egui

vini-fda opened this issue · 0 comments

The code on lib.rs (lines 198-205) contains a struct pattern error (shown below) because it doesn't account for the field accesskit_update that may be present on the egui::PlatformOutput type.

error[E0027]: pattern does not mention field `accesskit_update`
   --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/egui-miniquad-0.14.0/src/lib.rs:198:13
    |
198 |           let egui::PlatformOutput {
    |  _____________^
199 | |             cursor_icon,
200 | |             open_url,
201 | |             copied_text,
...   |
204 | |             mutable_text_under_cursor: _, // no IME
205 | |         } = platform_output;
    | |_________^ missing field `accesskit_update`

This is the signature for the struct PlatformOutput on egui:

#[derive(Default, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct PlatformOutput {
   [...]

    #[cfg(feature = "accesskit")]
    pub accesskit_update: Option<accesskit::TreeUpdate>,
}

Possible fix: as suggested by the Rust compiler,

help: if you don't care about this missing field, you can explicitly ignore it
    |
204 |             mutable_text_under_cursor: _, .. } = platform_output;
    |                                         ~~~~~~