mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Use parse_headers
rather than parsing body (#1090)
Looking at the internals, this should make almost no difference in performance, but anyway...
This commit is contained in:
parent
b5cfd3616f
commit
036b7e5f43
1 changed files with 1 additions and 2 deletions
|
@ -75,8 +75,7 @@ pub enum Error {
|
|||
impl Metadata21 {
|
||||
/// Parse distribution metadata from metadata bytes
|
||||
pub fn parse(content: &[u8]) -> Result<Self, Error> {
|
||||
let msg = mailparse::parse_mail(content)?;
|
||||
let headers = msg.get_headers();
|
||||
let (headers, _) = mailparse::parse_headers(content)?;
|
||||
|
||||
let get_first_value = |name| {
|
||||
headers.get_first_header(name).and_then(|header| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue