Registry / utility / remain

remain

JSON →
library0.2.15rscratesunverified

Provides compile-time checks that enum variants, struct fields, or match arms are written in sorted order.

# Cargo.toml [dependencies] remain = "0.2.15"
INSTALL
IMPORT
SIG · REMAIN
R
remain
utilityrustv0.2.15
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sorted
use remain::sorted;

Annotates an enum with #[sorted] to enforce alphabetical order of variants at compile time.

use remain::sorted; #[sorted] #[derive(Debug)] enum Color { Blue, Green, Red, } fn main() { let c = Color::Red; println!("{:?}", c); }
Debug
Known issues
gotchaThe #[sorted] attribute must be placed before #[derive] or other attributes; order matters.
fix
Place #[sorted] as the first attribute on the enum or struct.
affects: >=0.1.0
Upgrade
Version history
0.2.15latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
remain — cargo add remain · libregistry