Book Image

Building Reusable Code with Rust [Video]

By : Shing Lyu
5 (1)
Book Image

Building Reusable Code with Rust [Video]

5 (1)
By: Shing Lyu

Overview of this book

Rust is the ideal language for writing safe, correct code in a way that won't make you pull your hair out. This course will teach you how to build reusable Rust code so that you can stop copying and pasting code. Write code that can adapt to many different usages. You will reuse code by using advanced features such as traits, generics and macros. You will work with different forms of code reuse, loops, map, filter and fold to save time and resources. Achieve higher-level reuse without sacrificing runtime performance. Organize your code into modules and crates to publish them to crates.io. By the end of the course you will be able to avoid code duplication and write clean reusable code. The code bundle for this video course is available at - https://github.com/PacktPublishing/Building-Reusable-Code-with-Rust
Table of Contents (5 chapters)
Chapter 5
Reusing the Code with Other People Using Modules and Crates
Content Locked
Section 3
Using a Crate with Cargo.toml
How do we reuse the modules we created or other people created? We can specify the dependency in Cargo.toml. - Learn how Cargo.toml works - How to use third-party or local crates - How to include the crate in the code with "extern crate" and "use"