Skip to main content

fetch_file_diff

Function fetch_file_diff 

Source
pub fn fetch_file_diff(path: &str) -> Result<DiffResult, RsGuardError>
Expand description

Fetches diff content from a pre-existing file on disk.

Reads the file, validates that it looks like a diff, and checks size limits. Used when --diff-file is specified to skip the GitHub API call.

ยงErrors

Returns RsGuardError::Config if the file does not exist or cannot be read, RsGuardError::EmptyDiff if the file is empty, RsGuardError::InvalidDiffContent if the content does not look like a diff, or RsGuardError::DiffTooLarge if it exceeds size limits.