LukeMathWalker / zero-to-production

Code for "Zero To Production In Rust", a book on API development using Rust.
https://www.zero2prod.com
Apache License 2.0
5.86k stars 519 forks source link

Chap 3 Section 3.4.3 issues with cargo test #221

Closed bvmcode closed 1 year ago

bvmcode commented 1 year ago

Here is my repo https://github.com/bvmcode/rust-email-newsletter

I am following along with the book through 3.4.3 and when running cargo test I am getting the error:

error[E0432]: unresolved import `newsletter::main`
 --> tests\health_check.rs:1:5
  |
1 | use newsletter::main;
  |     ^^^^^

Thanks in advance

LukeMathWalker commented 1 year ago

You cannot import a function defined in the binary (i.e. main.rs)—keep reading the chapter and it'll show you how to refactor to move it into the library!

bvmcode commented 1 year ago

Thank you @LukeMathWalker