cli_core/forms/fill.rs
1//! The commodity an account pick fills into a split.
2
3use super::FormOption;
4
5/// The commodity to fill after `account` is picked: its only commodity.
6pub fn commodity_fill(options: &[FormOption], account: &str) -> Option<String> {
7 options
8 .iter()
9 .find(|option| option.id == account)?
10 .commodity
11 .clone()
12}