Implement From traits on ArgAction for convenience.

This commit is contained in:
Jakob Stoklund Olesen
2017-03-07 15:13:55 -08:00
parent 83d3a1020d
commit 3578fbc428
2 changed files with 18 additions and 10 deletions

View File

@@ -23,6 +23,18 @@ pub enum ArgAction {
Convert(ValueConversion),
}
impl From<ArgumentLoc> for ArgAction {
fn from(x: ArgumentLoc) -> ArgAction {
ArgAction::Assign(x)
}
}
impl From<ValueConversion> for ArgAction {
fn from(x: ValueConversion) -> ArgAction {
ArgAction::Convert(x)
}
}
/// Legalization action to be applied to a value that is being passed to or from a legalized ABI.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ValueConversion {