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

pub fn while_true(x: i32) -> i32

while true

Basic usage:

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