Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub enum Outcome {
- Warning(Warning),
- Error(Error),
- }
- impl<T> From<T> for Outcome where Warning: From<T> {
- fn from(warn: T) -> Self {
- Self::Warning(warn.into())
- }
- }
- impl<T> From<T> for Outcome where Error: From<T> {
- fn from(err: T) -> Self {
- Self::Error(err.into())
- }
- }
- pub enum Warning {
- Warning1,
- // some other cases
- }
- // some implementations of From<T> for Warning
- pub enum Error {
- Error1,
- // some other cases
- }
- // some implementations of From<T> for Error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement