Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract review file contents #55

Open
danobi opened this issue Jan 15, 2024 · 0 comments
Open

Abstract review file contents #55

danobi opened this issue Jan 15, 2024 · 0 comments

Comments

@danobi
Copy link
Owner

danobi commented Jan 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant