Splitting crate into different files

I have a crate binary_tree and there are four files in src:
lib.rs, binary_tree.rs, node.rs, binary_search_tree.rs.
When i try to declare modules node, i get an error:
file not found for module `node2021-10-25 (3)

The broblem is that this file exists.

The file has to be node.rs and similar; your editor is showing it is only node.

2021-10-25 (5)
The same issue

At this point there's not much anyone can do to help given the screenshot you've provided. There's just not enough information.

Running cargo check may provide more information than your IDE. If its output doesn't lead you to a solution, try pasting the error here (as text, in a ```text block).

3 Likes

sometimes the vscode does not reflect the changes done in file system (e.g. renaming files) immediately... you may need to re-save the file showing "not-true-anymore" errors that will be removed automatically as a consequence...

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.