Skip to content

Commit

Permalink
import error
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhalev-im committed Apr 25, 2021
1 parent 911f167 commit 0925c72
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/daos.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// file not found for module `modules`
// help: to create the module `modules`, create file "src\daos\modules.rs" rustc(E0583)
mod modules;

// failed to resolve: maybe a missing crate `modules`?
// maybe a missing crate `modules`? rustc(E0433)
use crate::modules::users::dao::{hello};

pub fn example() {
// cannot find function `hello` in this scope
hello();
}
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
mod daos;

use crate::daos::{example};

fn main() {
println!("Hello, world!");
example();
}
1 change: 1 addition & 0 deletions src/modules/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod users;
3 changes: 3 additions & 0 deletions src/modules/users/dao.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn hello() {
println!("Hello, world!");
}
1 change: 1 addition & 0 deletions src/modules/users/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod dao;

0 comments on commit 0925c72

Please sign in to comment.