With HTTP/3 coming, guess we'll finally need a breaking change in the http crate. We made the Version type an opaque struct over an enum to allow adding more versions, but the compiler allows exhaustively matching the opaque struct anyways ;_;
Yea, maybe someday... Still, I was much more shocked that the compiler would "leak" private details of a struct by allowing to exhaustively match on it.
-
-
I don’t understand, do you have an example?
-
struct Version(Inner); match ver { Version::HTTP_10 | Version::HTTP_11 => (), } (There's a couple more constants, but still, no fallback arm is needed.)
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.