Skip to content

Conversation

@hdhoang
Copy link
Collaborator

@hdhoang hdhoang commented Mar 19, 2019

Also express the message-ACK relationship better.

todo: propagate further up the stack with better error handling.

implement #92, and may help with #20, #63.

@Pzixel
Copy link

Pzixel commented Mar 19, 2019

Self::from_u8(b).expect("unhandled MsgType")

From the docs:

Simple and safe type conversions in to Self. It is the reciprocal of Into.

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>.

So From shouldn't fail, and by fail they mean any failure, including panic, I consulted the devs some time ago, so you break the core assumptions by that.

@hdhoang
Copy link
Collaborator Author

hdhoang commented Mar 19, 2019

great, thanks for the pointer! I will move the error-handling somewhere more appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants