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 4 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.