1. 14
    Rustlings primitive_types1: Introducing boolean values
    35s

Rustlings primitive_types1: Introducing boolean values

Chris Biscardi
InstructorChris Biscardi
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 3 years ago

README for this exercise.

Chris Biscardi: [0:00] In primitive_types1, we're supposed to fill in the rest of the line that has code missing. No hints. No trick. Just get used to typing it. If we look at the error message, it says, "Expected identifier, found keyword if." That's because we have a let statement here that doesn't finish anything. That's because we have let statement here and the code isn't finished on this line.

[0:16] It goes to look for if to see the next piece of the code, and it's not expecting it. Above, we have let is_morning equals true. If is_morning, then we use the println macro to print "Good morning." Here, we're checking is_evening. We'll also set that to true. Our tests pass. Here, we're using a Boolean value of true and setting it equal to is_evening.

egghead
egghead
~ an hour ago

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

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

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!

Markdown supported.
Become a member to join the discussionEnroll Today