riker-rs / riker

Easily build efficient, highly concurrent and resilient applications. An Actor Framework for Rust.
https://riker.rs
MIT License
1.02k stars 69 forks source link

clippy module inception: module has the same name as its containing module #97

Closed igalic closed 4 years ago

igalic commented 4 years ago

I feel like these warnings are point towards a structural or architectural issue:

    Checking riker v0.4.0 (/home/meena/src/ap/riker)
warning: module has the same name as its containing module
 --> src/actor/mod.rs:1:1
  |
1 | pub mod actor;
  | ^^^^^^^^^^^^^^
  |
  = note: `#[warn(clippy::module_inception)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception

warning: module has the same name as its containing module
 --> src/kernel/mod.rs:1:1
  |
1 | pub(crate) mod kernel;
  | ^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception

warning: module has the same name as its containing module
 --> src/system/mod.rs:2:1
  |
2 | pub(crate) mod system;
  | ^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception

warning: module has the same name as its containing module
 --> src/actor/mod.rs:1:1
  |
1 | pub mod actor;
  | ^^^^^^^^^^^^^^
  |
  = note: `#[warn(clippy::module_inception)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception

warning: module has the same name as its containing module
 --> src/kernel/mod.rs:1:1
  |
1 | pub(crate) mod kernel;
  | ^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception

warning: module has the same name as its containing module
 --> src/system/mod.rs:2:1
  |
2 | pub(crate) mod system;
  | ^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
igalic commented 4 years ago

okay, i think i understand now. this is from src/kernel/providers.rs:

use crate::{
    actor::actor_cell::{ActorCell, ExtendedCell},
    actor::*,
    kernel::{kernel::kernel, mailbox::mailbox},
    system::{system::SysActors, ActorSystem, SystemMsg},
    validate::validate_name,
};

kernel::kernel::kernel is really bad, but the doubles aren't much better for understanding the system.

hardliner66 commented 4 years ago

I think it would be better if something like Kernel::new or KernelRef::new would be used instead of the kernel function.

igalic commented 4 years ago

closing since #108 was merged