[refactor](trx-server): use state data constructors for pub(crate) fields

Migrate ready_data_from_state and transmitting_data_from_state to use
the new ReadyStateData::new() and TransmittingStateData::new()
constructors instead of direct struct field initialization.

https://claude.ai/code/session_01XzurkeuUmamBuhQwxVy7T4
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-26 06:27:01 +00:00
committed by Stan Grams
parent 8ce2e4ed08
commit 337cb72974
+15 -15
View File
@@ -1033,29 +1033,29 @@ fn desired_machine_state(state: &RigState) -> RigMachineState {
} }
fn ready_data_from_state(state: &RigState, rig_info: trx_core::rig::RigInfo) -> ReadyStateData { fn ready_data_from_state(state: &RigState, rig_info: trx_core::rig::RigInfo) -> ReadyStateData {
ReadyStateData { ReadyStateData::new(
rig_info, rig_info,
freq: state.status.freq, state.status.freq,
mode: state.status.mode.clone(), state.status.mode.clone(),
vfo: state.status.vfo.clone(), state.status.vfo.clone(),
rx: state.status.rx.clone(), state.status.rx.clone(),
tx_limit: state.status.tx.as_ref().and_then(|tx| tx.limit), state.status.tx.as_ref().and_then(|tx| tx.limit),
locked: lock_state_from(state), lock_state_from(state),
} )
} }
fn transmitting_data_from_state( fn transmitting_data_from_state(
state: &RigState, state: &RigState,
rig_info: trx_core::rig::RigInfo, rig_info: trx_core::rig::RigInfo,
) -> TransmittingStateData { ) -> TransmittingStateData {
TransmittingStateData { TransmittingStateData::new(
rig_info, rig_info,
freq: state.status.freq, state.status.freq,
mode: state.status.mode.clone(), state.status.mode.clone(),
vfo: state.status.vfo.clone(), state.status.vfo.clone(),
tx: state.status.tx.clone(), state.status.tx.clone(),
locked: lock_state_from(state), lock_state_from(state),
} )
} }
fn lock_state_from(state: &RigState) -> bool { fn lock_state_from(state: &RigState) -> bool {