-
-
Notifications
You must be signed in to change notification settings - Fork 364
Add alternative for HeaderMap::entry that cannot error #267
Copy link
Copy link
Closed
Labels
A-headersArea: HTTP headersArea: HTTP headersB-rfcBlocked: request for comments. More discussion would help move this along.Blocked: request for comments. More discussion would help move this along.S-featureSeverity: feature. This adds something new.Severity: feature. This adds something new.
Milestone
Metadata
Metadata
Assignees
Labels
A-headersArea: HTTP headersArea: HTTP headersB-rfcBlocked: request for comments. More discussion would help move this along.Blocked: request for comments. More discussion would help move this along.S-featureSeverity: feature. This adds something new.Severity: feature. This adds something new.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently,
HeaderMap::entryis generic over its argument, allowing lazily parsing aHeaderName, but means that some of those types might not be valid, soentryreturnsResult<Entry, Error>. When alreadying passing aHeaderName, it causes code to deal with an error that can never happen, likeheaders.entry(HOST).expect("Host is a valid name").It'd be nice to add an alternative method that doesn't return a
Result, but allows fewer types.If considered for breaking changes, I'd rename the current to
try_entry, and make the new alternative justentry.