2

So I'm currently learning the Rust language on the official website and I'm in the middle of Chapter 12 where they want me to split some of my code from src/main.rs to src/lib.rs. At first I created a library crate named "minigrep" inside the binary crate:

  • minigrep
  • src
    • main.rs

but Rust couldn't find it. Next I tried moving it inside the src directory:

  • src
    • minigrep
    • main.rs

Any help as to how Rust can detect an external crate?

Peter Hall
  • 53,120
  • 14
  • 139
  • 204
toobie
  • 41
  • 2

0 Answers0