Open hdhoang opened 5 years ago
Self::from_u8(b).expect("unhandled MsgType")
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.
great, thanks for the pointer! I will move the error-handling somewhere more appropriate.
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.