Skip to main content

detect_format

Function detect_format 

Source
pub fn detect_format(path: Option<&Utf8Path>, content: &str) -> Format
Expand description

Detect the input format per ADR-0030 D4.

Precedence: file extension first (when path is Some), then content fingerprint, then fallback to Format::Refs. The caller’s explicit --format flag should short-circuit this function — it is the slowest of the three precedence rules in the ADR.