Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

return function rust

fn main() {
  let a = 10;
  
  println!("a = {}", foo(a));
}

fn foo(a: i8) -> i8 {
  if a > 0 {
    return 5;
  }
  else {
    a + 1
  }
}
 
PREVIOUS NEXT
Tagged: #return #function #rust
ADD COMMENT
Topic
Name
2+9 =