I get this error in vscode , why?
and how to fix it?
Since engin.rs
is in src/
you have to declare it in lib.rs
.
Then you can use it in browser.rs
with:
use crate::engin;
Or alternatively move browser.rs
into its own directory and put engin.rs
in there with it:
src/
lib.rs
browser/
mod.rs <-- renamed from browser.rs
engin.rs
Worth noting that another valid strategy is to just add a subdirectory, and not rename browser.rs
src/
lib.rs
browser.rs
browser/
engin.rs
This is equivalent to @OptimisticPeach's layout, just a different style. engin
is still a sub module of browser
here.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.