Plugging in our existing modules
Throughout the book, we have been building isolated modules in their own files or directories that only concern themselves with one process. For instance, the database file only focuses on creating and managing database connections. The to-do module only focuses on constructing to-do items, and the JSON serialization module is entirely concerned with serializing data structures to and from JSON. With all this in mind, we will see how easily these modules can be copied into our application and used. Once we have done this, you will get to appreciate firsthand why isolated modules are important.
First, we must define our dependencies in the Cargo.toml
file with the following code:
[dependencies] rocket = {version = "0.5.0-rc.2", features = ["json"]} bcrypt = "0.13.0" serde_json = "1.0.59" serde_yaml = "0.8.23" chrono = {version = "0.4.19", features = ["serde"]} serde = { version...