From fcc0ee3cb7bbb31b9e14da460d9b975917d15720 Mon Sep 17 00:00:00 2001 From: llama Date: Fri, 24 Oct 2025 19:25:58 +0800 Subject: [PATCH] add StateExt trait --- qt/launcher-gui/src-tauri/src/app.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qt/launcher-gui/src-tauri/src/app.rs b/qt/launcher-gui/src-tauri/src/app.rs index bb31b31d0..75418ef24 100644 --- a/qt/launcher-gui/src-tauri/src/app.rs +++ b/qt/launcher-gui/src-tauri/src/app.rs @@ -19,6 +19,16 @@ use crate::uv; pub const PROTOCOL: &str = "anki"; +pub trait StateExt { + fn flow(&self) -> &State; +} + +impl> StateExt for T { + fn flow(&self) -> &State { + self.state::().inner() + } +} + pub fn init() -> Option { let mut state = State::init().unwrap_or_else(State::UnknownError);