Closed chanced closed 1 month ago
Ah nice, I avoided this because I wanted to minimise the risky algorithm changes, but it makes sense to do.
we could make Pointer::parse into a const fn but it would mean accepting &str
Yeah I considered that, but figured from_static
would likely be more useful in const
contexts (plus validate
wasn't const
). I'm not sure about the trade-off, I think AsRef<str>
is likely more useful than having parse
be const
. We could add a separate parse_const
instead, I'd be totally fine with that.
Ah nice, I avoided this because I wanted to minimise the risky algorithm changes, but it makes sense to do.
Yea, same, but our test coverage is solid enough now that I think this is safe enough. Plus its possible now that errors don't allocate.
We could add a separate parse_const instead, I'd be totally fine with that.
Nah, I like from_static
more.
This merges
is_valid
andvalidate
so that the logic is not replicated.@asmello we could make
Pointer::parse
into aconst fn
but it would mean accepting&str
: