feat: convert 1st digit of status firstly
…to avoid converting incorrect status codes to `StatusCode` enum. I think it would give +0.001% to performance on invalid statuses :)
This commit is contained in:
parent
61828f18d2
commit
148708ee68
1 changed files with 3 additions and 3 deletions
|
@ -103,10 +103,10 @@ impl Status {
|
|||
let code = first * 10 + second;
|
||||
|
||||
Ok(Status {
|
||||
// get enum item for 2-digit status code
|
||||
status_code: StatusCode::try_from_primitive(code)?,
|
||||
// get enum entry for first digit
|
||||
// get enum entry for the first digit
|
||||
reply_type: ReplyType::try_from_primitive(first)?,
|
||||
// get enum item for the 2-digit status code
|
||||
status_code: StatusCode::try_from_primitive(code)?,
|
||||
// provide separate field for the 2nd digit
|
||||
second_digit: second,
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue