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

Method code

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

Return the lines of code collected so far for this example. This is borrowed mutably because it may need to mutate the code lines based on the state accrued so far.

(&mut self)

Source from the content-addressed store, hash-verified

807 /// This is borrowed mutably because it may need to mutate the code lines
808 /// based on the state accrued so far.
809 fn code(&mut self) -> &[CodeExampleLine<'src>] {
810 match *self {
811 CodeExampleKind::Doctest(ref doctest) => &doctest.lines,
812 CodeExampleKind::Rst(ref mut litblock) => litblock.indented_code(),
813 CodeExampleKind::Markdown(ref fenced) => &fenced.lines,
814 }
815 }
816
817 /// Consume this code example and return only the lines that have been
818 /// accrued so far.

Callers 1

formatMethod · 0.45

Calls 1

indented_codeMethod · 0.80

Tested by

no test coverage detected