Skip to content

[bug] Inconsistent module definition style: platform/mod.rs vs `pages.rs #311

Description

@shiyeah123

The project mixes two different Rust module definition patterns, which may confuse contributors:

Pattern 1 (old style): platform/mod.rs

src/platform/
├── mod.rs        ← contains declarations AND implementation code
├── wayland.rs
└── x11.rs

Pattern 2 (modern style): pages.rs + pages/ directory

src/app/
├── pages.rs      ← contains only declarations
└── pages/
    ├── clipboard.rs
    └── common.rs

Both patterns are functionally equivalent since Rust 2018+, but the modern style (pages.rs) is generally preferred because:

  • It keeps sibling files at the same directory level
  • Avoids the ambiguity of multiple mod.rs files in large projects

Suggested fix: Migrate platform/mod.rs to the modern pattern (platform.rs + platform/ directory) for consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationgood first issueGood for newcomerslow priorityStuff that isn't very importantnot assignedIssues that are free for people to work on

    Type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions