#ord #options #order #transparent #everything #true #smaller

macro option_ord

configure ordering on 1+T with the 1 either smallest or largest, explicit vs derive default

4 releases

new 0.1.3 Jan 22, 2025
0.1.2 Dec 26, 2024
0.1.1 Oct 11, 2024
0.1.0 Jul 22, 2024

#691 in Procedural macros

Download history 1/week @ 2024-10-04 167/week @ 2024-10-11 5/week @ 2024-10-18 3/week @ 2024-12-06 59/week @ 2024-12-20 78/week @ 2024-12-27 1/week @ 2025-01-03 3/week @ 2025-01-10 44/week @ 2025-01-17

185 downloads per month

MIT license

5KB
61 lines

proc macro so that

struct MyOption(Option) where T : Ord;

becomes transparent, and gets the implementation of Ord where the None is bigger/smaller than all the Some(_)

and without generics as well as in #[transparent_option_ord(true)] struct MyOption(Option); which puts None as smaller than everything else

Dependencies

~1.5MB
~37K SLoC