Skip to main content

detect_eol

Function detect_eol 

Source
pub fn detect_eol(text: &str) -> &'static str
Expand description

Detect the dominant line ending in text.

Returns "\r\n" when CRLF sequences are present and at least as common as bare LF; otherwise returns "\n".

This is the canonical implementation used by all AST and ops modules to preserve the original file’s line ending style during content reconstruction.