From the course: Coding Exercises: Rust

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Has a deadline been reached?

Has a deadline been reached? - Rust Tutorial

From the course: Coding Exercises: Rust

Has a deadline been reached?

(dramatic music) - [Narrator] I'm always forgetting my friend's birthdays which is why this challenge is especially important for me. Challenge seven, check deadline. In this challenge, we will be asked to create a function that can tell whether or not an event's date has already occurred. Well, we tested in two ways. Firstly, we haven't worked with time before and secondly we'll be using third party code. Requirements, we must design an important event data structure, that has at least fields to store the name and the date. Let's say we're talking about a friend's birthday, we want to know who it is and when the birthday is. We must implement the deadline trait for important event. Feel free to use your local time zone. Here are two further details. Firstly, you don't need to implement your own time handling routines. Time handling is provided by the chrono crate. The sample code will automatically download and compile…

Contents