Skip to content

Abstract review file contents #55

Description

@danobi

Right now we pass around strings and string references everywhere. It mostly works, except in a few places it's ambiguous whether or not text is quoted or unquoted text that represents quoted text (or some other combination). It would be great to unify all text behind a data structure ike LineType:

prr/src/review.rs

Lines 51 to 59 in 6b4a4bf

/// Represents a single line in a review file.
enum LineType<'a> {
/// Original text (but stored without the leading `> `)
Quoted(&'a str),
/// A snip (`[..]`)
Snip,
/// User supplied comment
Comment(&'a str),
}

That way, we can unambiguously pass around Vec<LineType> (or similar) and unify all the quoting / dequoting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions