rss icon indicating copy to clipboard operation
rss copied to clipboard

Parse, don't validate

Open expenses opened this issue 7 months ago • 0 comments

Hi, I really appreciate this crate and like how it's laid out. One change I'd like is to be able to get out the parsed values of things like channels, which are currently just thrown away in the fn validate(&self) -> Result<(), ValidationError> functions. This would change things from being validation functions to parsing functions following parse, don't validate.

struct ParsedChannel {
    link: Url,
    docs: Option<Url>,
    last_build_date: Option<DateTime>,
    ...
}

impl Parse for Channel {
    type Parsed = ParsedChannel;

    fn parse(&self) -> Result<Self::Parsed, ParseError> {
        ...
    }
}

expenses avatar Jul 11 '25 13:07 expenses