Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make config wrap validators #1341

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Make config wrap validators #1341

wants to merge 1 commit into from

Conversation

adriangb
Copy link
Member

Initial stab at #1337.

Lots more work needed

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Just some general ideas - I think we should try to move forward here!

type Error = PyErr;
fn try_from(value: Bound<'_, PyDict>) -> Result<Self, Self::Error> {
Ok(CoreConfig {
title: value.get_item("title")?.map(|v| v.extract()).transpose()?,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we use a helper function to reduce the repetition with the ?.map(|v| v.extract()).transpose()??

Copy link
Member

Choose a reason for hiding this comment

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

Maybe a helper function and a macro would be a good combo here

}

#[derive(Debug, Clone)]
pub enum CacheStrings {
Copy link
Member

Choose a reason for hiding this comment

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

Nice to see all of these moved to an intuitive place

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

Successfully merging this pull request may close these issues.

2 participants