From ed091d43984c4e555246bca59891d457a3e6fbe4 Mon Sep 17 00:00:00 2001 From: KeyffMS <124252104+KeyffMS@users.noreply.github.com> Date: Sat, 19 Sep 2026 09:20:43 +0200 Subject: [PATCH] refactor: move profile state helpers (R2j) --- crates/lantern-app/src/application.rs | 16 ---------------- crates/lantern-app/src/application/state.rs | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/crates/lantern-app/src/application.rs b/crates/lantern-app/src/application.rs index 044d8742..e7fdf046 100644 --- a/crates/lantern-app/src/application.rs +++ b/crates/lantern-app/src/application.rs @@ -1,7 +1,6 @@ use std::sync::Arc; use lantern_domain::{DriveState, ProfileId, SessionId}; -use lantern_profile::ValidatedDeviceProfile; use crate::{ AuditHealth, Authorization, BackupCaptureRequest, BackupRestoreAction, BackupRestoreEffect, @@ -496,21 +495,6 @@ impl ApplicationState { )) } - fn selected_profile(&self) -> Option> { - self.active_profile - .as_ref() - .and_then(|id| self.registry.get(id)) - .map(|entry| Arc::clone(entry.profile())) - } - - fn profile_candidates(&self) -> Vec> { - self.registry - .entries() - .values() - .map(|entry| Arc::clone(entry.profile())) - .collect() - } - fn translate_session_effects(&mut self, effects: Vec) -> Vec { let mut translated = Vec::with_capacity(effects.len() + 1); if effects.contains(&SessionEffect::StopPlanner) diff --git a/crates/lantern-app/src/application/state.rs b/crates/lantern-app/src/application/state.rs index e8b9dbd9..633b469b 100644 --- a/crates/lantern-app/src/application/state.rs +++ b/crates/lantern-app/src/application/state.rs @@ -120,4 +120,19 @@ impl ApplicationState { pub const fn session(&self) -> &SessionStateMachine { &self.session } + + pub(super) fn selected_profile(&self) -> Option> { + self.active_profile + .as_ref() + .and_then(|id| self.registry.get(id)) + .map(|entry| Arc::clone(entry.profile())) + } + + pub(super) fn profile_candidates(&self) -> Vec> { + self.registry + .entries() + .values() + .map(|entry| Arc::clone(entry.profile())) + .collect() + } }