From the course: Rust Programming: From Fundamentals to Advanced Concepts with AI-Assisted Development
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Demo: Using Cargo for dependencies - Rust Tutorial
From the course: Rust Programming: From Fundamentals to Advanced Concepts with AI-Assisted Development
Demo: Using Cargo for dependencies
- [Instructor] We've made a lot of progress in our library, our Rust library. We've added a function here, which is the read_stdin(), and now it's time, like it's very well organized. We have the basic, we have the Makefile. We don't have dependencies yet, but now that we have this here, what I want is to actually use what we've created right there, like the read_stdin(). Remember we extracted that function away from another package that I had. So how does this work? Well, we're going to go back to this other project and then pull this in. Now I know what the path is for this library, this cli-utils, so let's go ahead and see how we can do that. So this is the resplit project. Remember, if I go to lib.rs, the read_stdin() used to be here. So I'm going to instead of like call it right there, this is read_stdin() and that is, let's check where that's getting used. It's not getting used here. It's actually, let's see in main.rs. So in main.rs, you can see it comes right there. So instead…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Introduction to modules1m 5s
-
(Locked)
Demo: Using Cargo for dependencies5m 25s
-
(Locked)
Demo: Extending with modules4m 52s
-
(Locked)
Demo: Verify code with doctest5m
-
(Locked)
Demo: Defining public and private modules6m 12s
-
(Locked)
Demo: Private and public fields in structs10m 26s
-
(Locked)
Summary of modules1m 5s
-
(Locked)
-
-