Rocket
Rocket copied to clipboard
Update form Error types to improve lifetimes
Adds an override of the extend method that enables derived form
validators to return form::Result<'static, ()>. It appears the central
issue is the Cow<'v, [Cow<'v, str>]> potentially held by the
ErrorKind struct, which Rust can't automatically shorten the lifetime
for. In theory, it should be safe to perform the same transform via an
unsafe transmute, but I would rather avoid unsafe code, and rely on the
compiler to recogize that it's effectively a no-op.