in this example, there are at least 3 different crates in the same package:
- a binary crate
gui, root module is source filesrc/bin/gui.rs - a binary crate
jonathan(same as the package name), root module issrc/main.rs - a library crate
jonathan(same as the package name), root module issrc/lib.rs
when you use crate::read_csv in each crate, the crate keyword refers to the root module of its own crate, so it will only work in main.rs where you have declared the module with mod read_csv;
when you write jonathan::read_csv, jonathan refers to the library crate. this can be resolved correctly if you have pub mod read_cvs; in lib.rs. it will NOT work with an empty lib.rs
see also my previous answer on these terms and concepts: Is a static in lib.rs unresolvable - #9 by nerditation