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
refactor: avoid unnecessary .expect()s for empty HeaderMap (#768)
* Avoid unnecessary .expect()s for empty HeaderMap
This change removes the Result::expect() calls in the constructors for
an empty HeaderMap. These calls were provably not going to fail at
runtime but rustc's inliner wasn't smart enough to figure that out:
strings analysis of compiled binaries showed that the error message to
the expect() still showed up in generated code.
There are no behavioral differences as a result of this change.
* Move new_empty() body into `Default` impl
This gives us one fewer named method since we can use default() in place
of new_empty(). It preserves the property that `HeaderMap::new()`
constrains the generic type to `T=HeaderValue`.
0 commit comments