Skip to main content

looks_path_like

Function looks_path_like 

Source
pub fn looks_path_like(val: &str) -> bool
Expand description

Returns true when the value looks like a file path rather than prose.

Criteria (any of):

  • starts with /, ./, ../, or ~
  • ends with .md or .txt (case-insensitive)

and contains no newlines and no multi-space runs (prose guard).