Open WhyNotHugo opened 1 year ago
Oh, I just realised that CI failed due to panic!
not being available on the MSRV. I'll try refactoring that.
We could probably update the MSRV, depending on what the version required is and how old it is.
Rust 1.57.0, from 2021-12-02
For tokio, the current MSRV is 1.56.0.
I've updated the PR to panic without panic!
. I used ([] as [u8; 0])[0];
, which is already used as a const panic!
hack in a couple of other places in the codebase.
We can remove this hack (both this new instance and existing ones) once the MSRV is bumped to 1.57.0 or greater.
I was wondering if we could add a variant StaticRef(&'static [u8])
to the Method
Inner
enum instead of panicking on longer than 15 byte methods?
I don't know of any methods that are longer than 15 bytes, so I'm not sure that it's worth the effort.
What's this stuck on?
I would also like to see this being merged as it helps with implementing a webdav server base on hyper
I don't know of any methods that are longer than 15 bytes, so I'm not sure that it's worth the effort.
recently I stubbled over the BASELINE-CONTROL
webdav method wich is longe than 15 bytes (16)
I was wondering if we could add a variant
StaticRef(&'static [u8])
to theMethod
Inner
enum instead of panicking on longer than 15 byte methods?
figured out that this wouldn't work with the current implementation since the equality also checks the enum variant wich is required that Method
can support pattern matching
Allows creating constant
Method
instances, e.g.:Fixes: https://github.com/hyperium/http/issues/587