[][src]Function tao_of_rust::ch02::control_flow::if_true

pub fn if_true(x: i32) -> i32

if true

Basic usage:

fn if_true(x: i32) -> i32 {
    if true {  // error[E0308]: mismatched types,expected type `i32` found type `()`
        return x+1;
    }
}
let y = if_true(5);
assert_eq!(y, 6);Run