Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Make config wrap validators#1341

Draft
adriangb wants to merge 1 commit intomainfrom
config-wrap
Draft

Make config wrap validators#1341
adriangb wants to merge 1 commit intomainfrom
config-wrap

Conversation

@adriangb
Copy link
Copy Markdown
Member

Initial stab at #1337.

Lots more work needed

Copy link
Copy Markdown
Contributor

@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!

Comment thread src/config.rs
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

Comment thread src/config.rs
}

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

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants