Implement From traits on ArgAction for convenience.

This commit is contained in:
Jakob Stoklund Olesen
2017-03-07 15:13:55 -08:00
parent 40fc5da3d8
commit 2de210ddb6
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 {