Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. // functions2.rs
  2. // Make me compile! Scroll down for hints :)
  3.  
  4. fn main() {
  5. call_me(3);
  6. }
  7.  
  8. fn num call_me(num) {
  9. for i in 0..num {
  10. println!("Ring! Call number {}", i + 1);
  11. }
  12. }
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. // Rust requires that all parts of a function's signature have type annotations,
  42. // but `call_me` is missing the type annotation of `num`.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement