Optimize parse_header_retry_after

Use next_back instead of last

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Jiahao XU 2025-04-05 00:53:23 +11:00 committed by GitHub
parent f3c04c8fed
commit 514151163b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -390,7 +390,7 @@ fn parse_header_retry_after(headers: &HeaderMap) -> Option<Duration> {
let header = headers
.get_all(RETRY_AFTER)
.into_iter()
.last()?
.next_back()?
.to_str()
.ok()?;