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:
|
/// 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.
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
That way, we can unambiguously pass around
Vec<LineType>(or similar) and unify all the quoting / dequoting.