From 099ab0b79bd906d44836ac1b9e1ab56edcd61c2e Mon Sep 17 00:00:00 2001 From: ostamax Date: Thu, 16 Jun 2022 18:08:26 +0300 Subject: [PATCH] minor changes --- exercises/functions/functions1.rs | 1 - exercises/functions/functions2.rs | 1 - exercises/functions/functions3.rs | 1 - exercises/functions/functions4.rs | 1 - exercises/functions/functions5.rs | 1 - exercises/if/if1.rs | 1 - exercises/if/if2.rs | 1 - exercises/intro/intro1.rs | 1 - exercises/intro/intro2.rs | 1 - exercises/move_semantics/move_semantics1.rs | 1 - exercises/move_semantics/move_semantics2.rs | 1 - exercises/move_semantics/move_semantics3.rs | 1 - exercises/move_semantics/move_semantics4.rs | 1 - exercises/move_semantics/move_semantics5.rs | 1 - exercises/move_semantics/move_semantics6.rs | 1 - exercises/quiz1.rs | 10 ++++++++-- exercises/variables/variables1.rs | 1 - exercises/variables/variables2.rs | 1 - exercises/variables/variables3.rs | 1 - exercises/variables/variables4.rs | 1 - exercises/variables/variables5.rs | 1 - exercises/variables/variables6.rs | 1 - 22 files changed, 8 insertions(+), 23 deletions(-) diff --git a/exercises/functions/functions1.rs b/exercises/functions/functions1.rs index a3286e47..0bfb389f 100644 --- a/exercises/functions/functions1.rs +++ b/exercises/functions/functions1.rs @@ -1,7 +1,6 @@ // functions1.rs // Make me compile! Execute `rustlings hint functions1` for hints :) -// I AM NOT DONE fn call_me() { println!("Hello, world!"); } diff --git a/exercises/functions/functions2.rs b/exercises/functions/functions2.rs index d493ca65..fd72c3b4 100644 --- a/exercises/functions/functions2.rs +++ b/exercises/functions/functions2.rs @@ -1,7 +1,6 @@ // functions2.rs // Make me compile! Execute `rustlings hint functions2` for hints :) -// I AM NOT DONE fn main() { call_me(3); diff --git a/exercises/functions/functions3.rs b/exercises/functions/functions3.rs index 4c632f0a..7bbf3840 100644 --- a/exercises/functions/functions3.rs +++ b/exercises/functions/functions3.rs @@ -1,7 +1,6 @@ // functions3.rs // Make me compile! Execute `rustlings hint functions3` for hints :) -// I AM NOT DONE fn main() { call_me(6); diff --git a/exercises/functions/functions4.rs b/exercises/functions/functions4.rs index ac3b8ef9..0c3c6c30 100644 --- a/exercises/functions/functions4.rs +++ b/exercises/functions/functions4.rs @@ -4,7 +4,6 @@ // This store is having a sale where if the price is an even number, you get // 10 Rustbucks off, but if it's an odd number, it's 3 Rustbucks off. -// I AM NOT DONE fn main() { let original_price = 51; diff --git a/exercises/functions/functions5.rs b/exercises/functions/functions5.rs index d4ceceed..ee79e792 100644 --- a/exercises/functions/functions5.rs +++ b/exercises/functions/functions5.rs @@ -1,7 +1,6 @@ // functions5.rs // Make me compile! Execute `rustlings hint functions5` for hints :) -// I AM NOT DONE fn main() { let answer = square(3); diff --git a/exercises/if/if1.rs b/exercises/if/if1.rs index d2270f89..7f3edfbe 100644 --- a/exercises/if/if1.rs +++ b/exercises/if/if1.rs @@ -1,6 +1,5 @@ // if1.rs -// I AM NOT DONE pub fn bigger(a: i32, b: i32) -> i32 { // Complete this function to return the bigger number! diff --git a/exercises/if/if2.rs b/exercises/if/if2.rs index 11ec40af..710695cf 100644 --- a/exercises/if/if2.rs +++ b/exercises/if/if2.rs @@ -4,7 +4,6 @@ // Step 2: Get the bar_for_fuzz and default_to_baz tests passing! // Execute the command `rustlings hint if2` if you want a hint :) -// I AM NOT DONE pub fn fizz_if_foo(fizzish: &str) -> &str { if fizzish == "fizz" { diff --git a/exercises/intro/intro1.rs b/exercises/intro/intro1.rs index 1c4582de..4fde4bed 100644 --- a/exercises/intro/intro1.rs +++ b/exercises/intro/intro1.rs @@ -5,7 +5,6 @@ // ready for the next exercise, remove the `I AM NOT DONE` comment below. // Execute the command `rustlings hint intro1` for a hint. -// I AM NOT DONE fn main() { println!("Hello and"); diff --git a/exercises/intro/intro2.rs b/exercises/intro/intro2.rs index 0e963303..2267c9d3 100644 --- a/exercises/intro/intro2.rs +++ b/exercises/intro/intro2.rs @@ -2,7 +2,6 @@ // Make the code print a greeting to the world. // Execute `rustlings hint intro2` for a hint. -// I AM NOT DONE fn main() { println!("Hello {}!", "world"); diff --git a/exercises/move_semantics/move_semantics1.rs b/exercises/move_semantics/move_semantics1.rs index 007a9f3b..78e4f8aa 100644 --- a/exercises/move_semantics/move_semantics1.rs +++ b/exercises/move_semantics/move_semantics1.rs @@ -1,7 +1,6 @@ // move_semantics1.rs // Make me compile! Execute `rustlings hint move_semantics1` for hints :) -// I AM NOT DONE fn main() { let vec0 = Vec::new(); diff --git a/exercises/move_semantics/move_semantics2.rs b/exercises/move_semantics/move_semantics2.rs index 62913ebc..ee556ccd 100644 --- a/exercises/move_semantics/move_semantics2.rs +++ b/exercises/move_semantics/move_semantics2.rs @@ -2,7 +2,6 @@ // Make me compile without changing line 13 or moving line 10! // Execute `rustlings hint move_semantics2` for hints :) -// I AM NOT DONE fn main() { let vec0 : Vec = Vec::new(); diff --git a/exercises/move_semantics/move_semantics3.rs b/exercises/move_semantics/move_semantics3.rs index 0557e4db..38ae109c 100644 --- a/exercises/move_semantics/move_semantics3.rs +++ b/exercises/move_semantics/move_semantics3.rs @@ -3,7 +3,6 @@ // (no lines with multiple semicolons necessary!) // Execute `rustlings hint move_semantics3` for hints :) -// I AM NOT DONE fn main() { let vec0 = Vec::new(); diff --git a/exercises/move_semantics/move_semantics4.rs b/exercises/move_semantics/move_semantics4.rs index 8d118bd8..d30624ba 100644 --- a/exercises/move_semantics/move_semantics4.rs +++ b/exercises/move_semantics/move_semantics4.rs @@ -4,7 +4,6 @@ // freshly created vector from fill_vec to its caller. // Execute `rustlings hint move_semantics4` for hints! -// I AM NOT DONE fn main() { // let vec0 = Vec::new(); diff --git a/exercises/move_semantics/move_semantics5.rs b/exercises/move_semantics/move_semantics5.rs index 44e896db..3f00b131 100644 --- a/exercises/move_semantics/move_semantics5.rs +++ b/exercises/move_semantics/move_semantics5.rs @@ -3,7 +3,6 @@ // adding, changing or removing any of them. // Execute `rustlings hint move_semantics5` for hints :) -// I AM NOT DONE fn main() { let mut x = 100; diff --git a/exercises/move_semantics/move_semantics6.rs b/exercises/move_semantics/move_semantics6.rs index bea7dfbe..55741e46 100644 --- a/exercises/move_semantics/move_semantics6.rs +++ b/exercises/move_semantics/move_semantics6.rs @@ -2,7 +2,6 @@ // Make me compile! `rustlings hint move_semantics6` for hints // You can't change anything except adding or removing references -// I AM NOT DONE fn main() { let data = "Rust is great!".to_string(); diff --git a/exercises/quiz1.rs b/exercises/quiz1.rs index 7bd3f589..3aff578f 100644 --- a/exercises/quiz1.rs +++ b/exercises/quiz1.rs @@ -8,10 +8,16 @@ // more than 40 at once, each apple only costs 1! Write a function that calculates // the price of an order of apples given the quantity bought. No hints this time! -// I AM NOT DONE // Put your function here! -// fn calculate_apple_price { +fn calculate_apple_price(quantity: i32) -> i32 { + if quantity > 40 { + quantity + } + else { + quantity * 2 + } +} // Don't modify this function! #[test] diff --git a/exercises/variables/variables1.rs b/exercises/variables/variables1.rs index 6b67c101..7ef36fd0 100644 --- a/exercises/variables/variables1.rs +++ b/exercises/variables/variables1.rs @@ -2,7 +2,6 @@ // Make me compile! // Execute the command `rustlings hint variables1` if you want a hint :) -// I AM NOT DONE fn main() { let x = 5; diff --git a/exercises/variables/variables2.rs b/exercises/variables/variables2.rs index ced90b88..be2ca14e 100644 --- a/exercises/variables/variables2.rs +++ b/exercises/variables/variables2.rs @@ -1,7 +1,6 @@ // variables2.rs // Make me compile! Execute the command `rustlings hint variables2` if you want a hint :) -// I AM NOT DONE fn main() { let x = 10; diff --git a/exercises/variables/variables3.rs b/exercises/variables/variables3.rs index 1f13bdad..3566ef22 100644 --- a/exercises/variables/variables3.rs +++ b/exercises/variables/variables3.rs @@ -1,7 +1,6 @@ // variables3.rs // Make me compile! Execute the command `rustlings hint variables3` if you want a hint :) -// I AM NOT DONE fn main() { let mut x = 3; diff --git a/exercises/variables/variables4.rs b/exercises/variables/variables4.rs index 770e27da..ee24119e 100644 --- a/exercises/variables/variables4.rs +++ b/exercises/variables/variables4.rs @@ -1,7 +1,6 @@ // variables4.rs // Make me compile! Execute the command `rustlings hint variables4` if you want a hint :) -// I AM NOT DONE fn main() { let x: i32 = 100; diff --git a/exercises/variables/variables5.rs b/exercises/variables/variables5.rs index cd9846aa..d61e6c1b 100644 --- a/exercises/variables/variables5.rs +++ b/exercises/variables/variables5.rs @@ -1,7 +1,6 @@ // variables5.rs // Make me compile! Execute the command `rustlings hint variables5` if you want a hint :) -// I AM NOT DONE fn main() { let number = "T-H-R-E-E"; // don't change this line diff --git a/exercises/variables/variables6.rs b/exercises/variables/variables6.rs index 6afe3542..d4017ef9 100644 --- a/exercises/variables/variables6.rs +++ b/exercises/variables/variables6.rs @@ -1,7 +1,6 @@ // variables6.rs // Make me compile! Execute the command `rustlings hint variables6` if you want a hint :) -// I AM NOT DONE const NUMBER: i8 = 3; fn main() {