Compiling rust problem

I am actually writing a rust to Java transpiler and I've got many problems:
My compiler can read rust code like that:

fn main() {
   println!("{}",runtest(1.3));
}
fn runtest(a: f32) -> f32 {
  a * 8.0 - 6.0
}

but it don't understand the match expression, the if let statement the usage of if like a statement ...
So I want something to compile the rust to a more simple rust.

fn main() {
    println!("{}",if "test" == "test" {
1.0
} else {
0.0
});
}

This code don't work.
Thank's reading me,
ccgauche.

if let can be simplified to a match. However, match doesn't have a simpler Rust equivalent. It needs to be able to read enum's internal state. How enums are tagged is an implementation detail of the Rust compiler.

So to implement match you'd first need to implement enum in your compiler.

Yes but for the return for a block like:

if expression {
 SomeValue
} else {
 AnotherValue
}

I've watched MIR HIT LIR.

Sorry, I'm not sure what you're asking here. About Rust's semantics? About Java equivalent of that code?

I want this to be a more simple rust code where if is not a statement:

fn a() {
let a = if expression {
 SomeValue
} else {
 AnotherValue
}
}

I'm not sure if this is what you're asking...

In this example, if is an expression. If the let a = part wasn't there, it would be a statement. But assuming you meant "expression":

fn a() {
    let a;
    if expression {
        a = { SomeValue };
    } else {
        a = { AnotherValue };
    }
}

Yes it is that but are you sure that we can create let a; without any error

You can let a; without value only if the compiler can statically prove that it will be assigned a value exactly once before it is used. With let mut a; it must be assigned at least once, i.e. it could be reassigned on some paths.