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.43k stars 470 forks source link

Chap 3 Section 3.4.3 issues with cargo test #221

Closed bvmcode closed 9 months ago

bvmcode commented 9 months 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 9 months 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 9 months ago

Thank you @LukeMathWalker