apply_newline_style in rustfmt_nightly::formatting::newline_style - Rust
Description: Apply this newline style to the formatted text. When the style is set to `Auto`, the `raw_input_text` is used to detect the existing line endings.

Skip to main content

## apply_newline_style

# Function apply_newline_style

Source

    pub(crate) fn apply_newline_style(
        newline_style: NewlineStyle,
        formatted_text: &mut String,
        raw_input_text: &str,
    )

Expand description

Apply this newline style to the formatted text. When the style is set to `Auto`, the `raw_input_text` is used to detect the existing line endings.

If the style is set to `Auto` and `raw_input_text` contains no newlines, the `Native` style will be used.