cloudflare / cloudflare/pingora
Suggestion for Simplifying Module Organization
- Dominant language
- Rust
- Stars
- 27.4k
- Forks
- 1.7k
- Avg merge
- 6h 22m
- Merged PRs (30d)
- 3
Description
Hello,
While exploring the source code of the pingora project, I noticed that the organization of modules often involves the use of a directory with a single mod.rs file for many modules. This approach, although functional, seems somewhat unnecessary when a module does not have submodules. A simpler and more streamlined method would be to use a single file named after the module (`xxx.rs`) instead of creating a directory with a `mod.rs` file for modules without submodules.
Adopting this strategy can offer several benefits:
* Simplification: It simplifies the project structure, making it easier to navigate and understand, especially for new contributors or when quickly browsing the project.
* Consistency: It provides a consistent approach to module organization that aligns with Rust's module system's flexibility and capabilities.
* Efficiency: It may slightly reduce the number of files and directories, leading to less overhead when navigating the project in file explorers or IDEs.
I understand that this change would require a significant effort to reorganize existing code, and I appreciate the work that has already gone into developing pingora. However, I believe that this simplification could improve the project's overall maintainability and accessibility.
Would you be open to considering this suggestion for the future development of pingora? I am willing to assist in this transition if my proposal is accepted.
Thank you for your time and for your contributions to the open-source community. I look forward to your thoughts on this suggestion.
Contributor guide
Assessment
This issue has not been assessed yet.