README for this exercise.
Chris Biscardi: [0:00] In functions4, let's reverse what we've been doing and take a look at the error message first, expected type, found '{'. At line 14, function sale_price, price is an i32. There's an arrow here where Rust expected a type. If we find line 14, we can see that sale_price takes a parameter that is an i32. It doesn't have a return value even though we've used the arrow here.
[0:27] If we remember back to our if statement, we can see that we're implicitly returning price - 10 or price - 3. In that case, we can probably use an i32 since that's what the parameter is and we're operating with integers on it. Note our test is passed.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!