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

Simplify check_files #918

Closed
ranjitjhala opened this issue Dec 4, 2024 · 0 comments · Fixed by #920
Closed

Simplify check_files #918

ranjitjhala opened this issue Dec 4, 2024 · 0 comments · Fixed by #920
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ranjitjhala
Copy link
Contributor

ranjitjhala commented Dec 4, 2024

We should represent the configuration field check_files as

    check_files: Paths,

where

#[derive(Default)]
struct Paths {
    paths: Vec<PathBuf>,
}

impl<'de> Deserialize<'de> for Paths {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let paths = <&str>::deserialize(deserializer)?
            .split(',')
            .into_iter()
            .map(PathBuf::from)
            .collect();
        Ok(Paths { paths })
    }
}

Originally posted by @nilehmann in #917 (comment)

@ranjitjhala ranjitjhala added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant