You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're currently creating one OnceCell per operation backing a static mime::Mime type for the operation's expected (if present) client Accept header value, only to then decompose it into type + subtype and perform a case-insensitive string comparison check against the actual incoming Accept header value.
It would be more efficient to directly compare &strs and avoid incurring the atomic read.
A simpler, more efficient, and type-safe approach would be to directly switch to something like mediatype, which is const-constructible and zero-copy. Note that mime is not actively maintained.
See #2607 (comment) and #2629, the PR where we started using OnceCells for this.
The text was updated successfully, but these errors were encountered:
hyperium/mime#153 proposes to solve these issues in mime and actively maintain the crate. We work with other of their crates, if it's worth seeing what the proposal will look like and possibly continue with mime
We're currently creating one
OnceCell
per operation backing a staticmime::Mime
type for the operation's expected (if present) clientAccept
header value, only to then decompose it into type + subtype and perform a case-insensitive string comparison check against the actual incomingAccept
header value.It would be more efficient to directly compare
&str
s and avoid incurring the atomic read.A simpler, more efficient, and type-safe approach would be to directly switch to something like
mediatype
, which is const-constructible and zero-copy. Note thatmime
is not actively maintained.See #2607 (comment) and #2629, the PR where we started using
OnceCell
s for this.The text was updated successfully, but these errors were encountered: