Skip to main content

parse

Function parse 

Source
pub fn parse(content: &str) -> Result<ParsedWatchFile, ParseError>
Expand description

Parse a watch file with automatic format detection

This function detects whether the input is line-based (v1-4) or deb822 format (v5) and parses it accordingly, returning a unified ParsedWatchFile enum.

ยงExamples

use debian_watch::parse::parse;

let content = "version=4\nhttps://example.com/ .*.tar.gz";
let parsed = parse(content).unwrap();
assert_eq!(parsed.version(), 4);