#ord #options #transparent #generics #macro #smallest #explicit

macro bin option_ord

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

2 releases

0.1.1 Oct 11, 2024
0.1.0 Jul 22, 2024

#581 in Procedural macros

Download history 107/week @ 2024-07-22 17/week @ 2024-09-16 6/week @ 2024-09-23 6/week @ 2024-09-30 146/week @ 2024-10-07 26/week @ 2024-10-14

185 downloads per month

MIT license

6KB
87 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
~36K SLoC