[GH-ISSUE #36] Remove panic!() from op_code From impl #25

Closed
opened 2026-03-07 22:18:05 +03:00 by kerem · 3 comments
Owner

Originally created by @bluejekyll on GitHub (Aug 20, 2016).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/36

https://github.com/bluejekyll/trust-dns/blob/master/src/op/op_code.rs#L99

Might need to change away from the From trait and move towards a parser.

Originally created by @bluejekyll on GitHub (Aug 20, 2016). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/36 https://github.com/bluejekyll/trust-dns/blob/master/src/op/op_code.rs#L99 Might need to change away from the From trait and move towards a parser.
kerem 2026-03-07 22:18:05 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@alserio commented on GitHub (Aug 21, 2016):

Hi, just a quick note. The From trait documentation explicitly says:

Note: this trait must not fail. If the conversion can fail, use TryFrom or a dedicated method which returns an Option or a Result<T, E>.

<!-- gh-comment-id:241288804 --> @alserio commented on GitHub (Aug 21, 2016): Hi, just a quick note. The [From trait documentation](https://doc.rust-lang.org/std/convert/trait.From.html) explicitly says: > Note: this trait must not fail. If the conversion can fail, use TryFrom or a dedicated method which returns an Option<T> or a Result<T, E>.
Author
Owner

@bluejekyll commented on GitHub (Aug 22, 2016):

Yes, I'm aware of that restriction. I'll most likely be dropping the usage of that trait in this context in order to fix this bug.

<!-- gh-comment-id:241316118 --> @bluejekyll commented on GitHub (Aug 22, 2016): Yes, I'm aware of that restriction. I'll most likely be dropping the usage of that trait in this context in order to fix this bug.
Author
Owner

@bluejekyll commented on GitHub (Aug 27, 2016):

Fixed in #42

<!-- gh-comment-id:242902883 --> @bluejekyll commented on GitHub (Aug 27, 2016): Fixed in #42
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#25
No description provided.