uuid-rs / uuid

Generate and parse UUIDs.

Home Page:https://www.crates.io/crates/uuid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why does Uuid implement Ord, PartialOrd?

timvisee opened this issue · comments

The Uuid type derives Ord and PartialOrd.

What is the reasoning behind implementing these? Aren't comparisons meaningless here, since we're essentially comparing random data?

I believe these are incorrect, and if so, they should be removed.

@timvisee For v4 UUIDs it doesn’t make a lot of sense, but v6 and v7 UUIDs are laid out to be byte-wise sortable. For these variants the ordering does make sense.