This commit is contained in:
jojimanos 2022-09-11 12:42:04 +03:00
parent 8d9a1461d3
commit 7c2e0d575d
2 changed files with 10 additions and 6 deletions

View File

@ -10,10 +10,14 @@
// Write a function that calculates the price of an order of apples given // Write a function that calculates the price of an order of apples given
// the quantity bought. No hints this time! // the quantity bought. No hints this time!
// I AM NOT DONE
// Put your function here! // Put your function here!
// fn calculate_price_of_apples { fn calculate_price_of_apples(price: u32)-> u32 {
if price > 40{
return price;
} else {
price*2
}
}
// Don't modify this function! // Don't modify this function!
#[test] #[test]

View File

@ -30,9 +30,9 @@ mod my_module {
use super::Command; use super::Command;
// TODO: Complete the function signature! // TODO: Complete the function signature!
pub fn transformer(input: ???) -> ??? { pub fn transformer(input: Vec = [Trim, "Hello"]) -> Vec {
// TODO: Complete the output declaration! // TODO: Complete the output declaration!
let mut output: ??? = vec![]; let mut output: Vec = vec![];
for (string, command) in input.iter() { for (string, command) in input.iter() {
// TODO: Complete the function body. You can do it! // TODO: Complete the function body. You can do it!
} }
@ -43,7 +43,7 @@ mod my_module {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// TODO: What do we have to import to have `transformer` in scope? // TODO: What do we have to import to have `transformer` in scope?
use ???; use vec![enum, ""];
use super::Command; use super::Command;
#[test] #[test]