talent-plan icon indicating copy to clipboard operation
talent-plan copied to clipboard

Output is different from the given in project_1 part1

Open stupidboy666 opened this issue 7 years ago • 2 comments

I always get the output like this:

error[E0432]: unresolved import `kvs::KvStore`
 --> tests/tests.rs:2:5
  |
2 | use kvs::KvStore;
  |     ^^^^^^^^^^^^ no `KvStore` in the root

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `kvs`.

To learn more, run the command again with --verbose.

so i can't run the test correctly, when i write nothing in my file.

stupidboy666 avatar Sep 24 '19 00:09 stupidboy666

Hi, I think that is the expected output if the lib.rs file is empty. You need to define the KvStore type in lib.rs

jakai7 avatar Oct 05 '20 14:10 jakai7

Hi, If you only copy the tests.rs file into tests/ directory. cargo test will thow the compile error because you haven't define the KvStore struct.

Subsequent content ask you to write the type and method definitions necessary in lib.rs to make cargo test --no-run complete successfully.

So define struct KvStore and relevant method asked by complier to pass cargo test --no-run command

zgzhong avatar Jun 09 '21 13:06 zgzhong