Skip to main content

has_matching_version

Function has_matching_version 

Source
pub fn has_matching_version(content: &str, expected: u32) -> bool
Expand description

Look for a # version: N line near the top of a cache file and return true if it parses to exactly expected. Older caches without the line, caches with a newer/older N, and malformed lines all return false so the caller can silently regenerate. Stops scanning at the first non-comment line to keep the cost bounded.