refactor: if -> match
This commit is contained in:
parent
59435072f5
commit
ec616d5846
1 changed files with 11 additions and 12 deletions
|
@ -69,19 +69,18 @@ macro_rules! supported_targets {
|
||||||
/// List of supported targets
|
/// List of supported targets
|
||||||
pub const TARGETS: &'static [&'static str] = &[$($triple),*];
|
pub const TARGETS: &'static [&'static str] = &[$($triple),*];
|
||||||
|
|
||||||
// this would use a match if stringify! were allowed in pattern position
|
|
||||||
fn load_specific(target: &str) -> Option<Target> {
|
fn load_specific(target: &str) -> Option<Target> {
|
||||||
if false { }
|
match target {
|
||||||
$(
|
$(
|
||||||
else if target == $triple {
|
$triple => {
|
||||||
let mut t = $module::target();
|
let mut t = $module::target();
|
||||||
t.options.is_builtin = true;
|
t.options.is_builtin = true;
|
||||||
debug!("Got builtin target: {:?}", t);
|
debug!("Got builtin target: {:?}", t);
|
||||||
return Some(t);
|
Some(t)
|
||||||
}
|
},
|
||||||
)*
|
)+
|
||||||
|
_ => None
|
||||||
None
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue