MCPcopy Create free account
hub / github.com/astral-sh/ruff / into_code

Method into_code

crates/ruff_python_formatter/src/string/docstring.rs:823–829  ·  view source on GitHub ↗

Consume this code example and return only the lines that have been accrued so far. This is useful when the code example being collected has been determined to be invalid, and one wants to "give up" and print the original lines through unchanged without attempting formatting.

(self)

Source from the content-addressed store, hash-verified

821 /// determined to be invalid, and one wants to "give up" and print the
822 /// original lines through unchanged without attempting formatting.
823 fn into_code(self) -> Vec<CodeExampleLine<'src>> {
824 match self {
825 CodeExampleKind::Doctest(doctest) => doctest.lines,
826 CodeExampleKind::Rst(litblock) => litblock.lines,
827 CodeExampleKind::Markdown(fenced) => fenced.lines,
828 }
829 }
830
831 /// This returns any extra indent that will be added after formatting this
832 /// code example.

Callers 5

formatted_fileFunction · 0.45
format_rangeFunction · 0.45
run_action_queueMethod · 0.45
black_compatibilityFunction · 0.45
format_fileFunction · 0.45

Calls

no outgoing calls

Tested by 2

black_compatibilityFunction · 0.36
format_fileFunction · 0.36