Skip to content

Commit

Permalink
ruff_python_formatter: improve docs on when a line is owned
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Nov 29, 2023
1 parent 313a073 commit cf96ed8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ impl<'ast, 'buf, 'fmt, 'src> DocstringLinePrinter<'ast, 'buf, 'fmt, 'src> {
#[derive(Clone, Debug)]
struct DocstringLine<'src> {
/// The actual text of the line, not including the line terminator.
///
/// In practice, this line is borrowed when it corresponds to an original
/// unformatted line in a docstring, and owned when it corresponds to a
/// reformatted line (e.g., from a code snippet) in a docstring.
line: Cow<'src, str>,
/// The offset into the source document which this line corresponds to.
offset: TextSize,
Expand Down

0 comments on commit cf96ed8

Please sign in to comment.