I'm trying to import a function present in a file named 'utils.rs' into a file named 'input.rs', but I'm getting the following error:
error[E0583]: file not found for module `utils`
--> src/input.rs:5:1
|
5 | mod utils;
| ^^^^^^^^^^
|
= help: to create the module `utils`, create file "src/input/utils.rs" or "src/input/utils/mod.rs"
error[E0432]: unresolved import `utils::rev_compl`
--> src/input.rs:6:5
|
6 | use utils::rev_compl;
| ^^^^^^^^^^^^^^^^ no `rev_compl` in `input::utils`
The structure of my directory src is:
main.rs
input.rs
process.rs
output.rs
utils.rs
I'm calling the function this way (top of input.rs file):
mod utils;
use utils::rev_compl;
And the function 'rev_compl' in the utils.rs file contains the 'pub' prefix:
pub fn revcompl(seq: &str) -> String {
Does anyone know how to solve this error? Thanks for your help!