From c2bd282af27737a759eefca1eca79bc608d7684e Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 17 Nov 2015 17:59:18 -0500 Subject: Make @ConnyOnny's example be 1st example in the `if` section! :tada: --- ex6.rs | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 ex6.rs (limited to 'ex6.rs') diff --git a/ex6.rs b/ex6.rs deleted file mode 100644 index 7302a2a..0000000 --- a/ex6.rs +++ /dev/null @@ -1,51 +0,0 @@ -fn bigger(a: i32, b:i32) -> i32 { - // Complete this function to return the bigger number! - // Do not use: - // - return - // - another function call - // - additional variables - // Scroll down for hints. -} - -fn main() { - assert_eq!(10, bigger(10, 8)); - assert_eq!(42, bigger(32, 42)); -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// What is Rust's equivalent of the ternary operator? -// In C(++) this would be: a>b ? a : b -// In Python it would be: a if a>b else b -// If you still can't do it: Search online for rust ternary operator - -- cgit v1.2.3