Skip to content

Conversation

@svix-jplatte
Copy link
Member

No description provided.

Comment on lines +47 to +61
#[derive(Debug, thiserror::Error)]
#[error("invalid value for productType")]
pub struct ConnectorProductFromStrError;

impl FromStr for ConnectorProduct {
type Err = ConnectorProductFromStrError;

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Dispatch" => Ok(Self::Dispatch),
"Stream" => Ok(Self::Stream),
_ => Err(ConnectorProductFromStrError),
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we didn't have to do this. Probably not too hard to incorporate in templates.

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