[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 {
ReadyStateData {
ReadyStateData::new(
rig_info,
freq: state.status.freq,
mode: state.status.mode.clone(),
vfo: state.status.vfo.clone(),
rx: state.status.rx.clone(),
tx_limit: state.status.tx.as_ref().and_then(|tx| tx.limit),
locked: lock_state_from(state),
}
state.status.freq,
state.status.mode.clone(),
state.status.vfo.clone(),
state.status.rx.clone(),
state.status.tx.as_ref().and_then(|tx| tx.limit),
lock_state_from(state),
)
}
fn transmitting_data_from_state(
state: &RigState,
rig_info: trx_core::rig::RigInfo,
) -> TransmittingStateData {
TransmittingStateData {
TransmittingStateData::new(
rig_info,
freq: state.status.freq,
mode: state.status.mode.clone(),
vfo: state.status.vfo.clone(),
tx: state.status.tx.clone(),
locked: lock_state_from(state),
}
state.status.freq,
state.status.mode.clone(),
state.status.vfo.clone(),
state.status.tx.clone(),
lock_state_from(state),
)
}
fn lock_state_from(state: &RigState) -> bool {