mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
option_parser: Create generic type Tuple
Creates a new generic type Tuple so that the same implementation of FromStr trait can be reused for both parsing a list of two integers and parsing a list of one integer associated with a list of integers. This anticipates the need for retrieving sublists, which will be needed when trying to describe the host CPU affinity for every vCPU. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
use clap::ArgMatches;
|
||||
use net_util::MacAddr;
|
||||
use option_parser::{
|
||||
ByteSized, IntegerList, OptionParser, OptionParserError, StringList, Toggle, TupleTwoIntegers,
|
||||
ByteSized, IntegerList, OptionParser, OptionParserError, StringList, Toggle, Tuple,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::convert::From;
|
||||
@@ -1942,7 +1942,7 @@ impl NumaConfig {
|
||||
.map_err(Error::ParseNuma)?
|
||||
.map(|v| v.0.iter().map(|e| *e as u8).collect());
|
||||
let distances = parser
|
||||
.convert::<TupleTwoIntegers>("distances")
|
||||
.convert::<Tuple<u64>>("distances")
|
||||
.map_err(Error::ParseNuma)?
|
||||
.map(|v| {
|
||||
v.0.iter()
|
||||
|
||||
Reference in New Issue
Block a user