Skip to content

proposal: use three block style for use declarations#80

Merged
AkshatM merged 2 commits intocloudflare:mainfrom
valkum:use-decl
Apr 23, 2026
Merged

proposal: use three block style for use declarations#80
AkshatM merged 2 commits intocloudflare:mainfrom
valkum:use-decl

Conversation

@valkum
Copy link
Copy Markdown
Contributor

@valkum valkum commented Apr 22, 2026

This now sorts use declarations in blocks, which is a widely used style and provides a better overview of external vs internal "uses".

The first block is for std, core, and alloc. The second one is for external crates. The third one is for crate internal use declarations.

I checked other Cloudflare Rust repos. In multiple repos, there are files that follow this style, but there are also a lot of files that do not. Some seem to have three blocks in a different order (std, internal, external). I, personally, think it improves readability. If you do not agree, feel free to just close this PR.

This PR is based on a comment on #74 (comment)

@AkshatM AkshatM marked this pull request as ready for review April 22, 2026 14:41
Copy link
Copy Markdown
Contributor

@AkshatM AkshatM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a CONTRIBUTING.md that references this style convention.

valkum added 2 commits April 23, 2026 12:34
This now sorts use declarations in blocks, which is a widely used style.
The first block is for std, core, and alloc. The second one is for
external crates. The third one is for crate internal use declarations.
@AkshatM
Copy link
Copy Markdown
Contributor

AkshatM commented Apr 23, 2026

Thank you for your contributions, @valkum ! They are much appreciated.

@AkshatM AkshatM merged commit 2a03faf into cloudflare:main Apr 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants