Added tests, some refactoring, fixed a parsing bug.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
a58ccb1125
commit
4525929df2
@@ -22,6 +22,18 @@ pub enum IsaSpec {
|
||||
Some(Vec<Box<TargetIsa>>),
|
||||
}
|
||||
|
||||
impl IsaSpec {
|
||||
/// If the `IsaSpec` contains exactly 1 `TargetIsa` we return a reference to it
|
||||
pub fn unique_isa(&self) -> Option<&TargetIsa> {
|
||||
if let &IsaSpec::Some(ref isa_vec) = self {
|
||||
if isa_vec.len() == 1 {
|
||||
return Some(&*isa_vec[0]);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse an iterator of command line options and apply them to `config`.
|
||||
pub fn parse_options<'a, I>(iter: I, config: &mut Configurable, loc: &Location) -> Result<()>
|
||||
where I: Iterator<Item = &'a str>
|
||||
|
||||
Reference in New Issue
Block a user