Skip to content

Commit

Permalink
greatly simplify logic -- thanks Lachlan!
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Apr 22, 2019
1 parent b3dacbf commit e8b2660
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/bin/wasmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,13 @@ enum Backend {

impl Backend {
pub fn variants() -> &'static [&'static str] {
#[cfg(all(feature = "backend:singlepass", feature = "backend:llvm"))]
{
&["cranelift", "singlepass", "llvm"]
}
#[cfg(all(not(feature = "backend:singlepass"), feature = "backend:llvm"))]
{
&["cranelift", "llvm"]
}
#[cfg(all(feature = "backend:singlepass", not(feature = "backend:llvm")))]
{
&["cranelift", "singlepass"]
}
#[cfg(all(not(feature = "backend:singlepass"), not(feature = "backend:llvm")))]
{
&["cranelift"]
}
&[
"cranelift",
#[cfg(feature = "backend:singlepass")]
"singlepass",
#[cfg(feature = "backend:llvm")]
"llvm",
]
}
}

Expand Down

0 comments on commit e8b2660

Please sign in to comment.