Rocket icon indicating copy to clipboard operation
Rocket copied to clipboard

Update form Error types to improve lifetimes

Open the10thWiz opened this issue 3 years ago • 0 comments

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.

the10thWiz avatar May 19 '22 15:05 the10thWiz