You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fields are currently hidden behind ref-getter functions Line::source and Line::line. This was done to allow for flexibility in the underlying data types (especially source which should really sit behind an Arc) without breaking the exposed API. But it would be nice to at least provide a way for reusing the existing String allocated for the line. A few options:
Straight destructuring would require making the fields pub, which I would personally be okay with, except for the constraint mentioned above. Just line being public could work.
Line::into_parts -> (PathBuf, String) could work (and just clone the Path if/when it becomes Arc'ed).
Line::take_line -> String and panic, or return "".to_string on future calls to that or Line::line.
impl Into<String> for Line and just consume self to pass along line.
The text was updated successfully, but these errors were encountered:
Fields are currently hidden behind ref-getter functions
Line::source
andLine::line
. This was done to allow for flexibility in the underlying data types (especiallysource
which should really sit behind anArc
) without breaking the exposed API. But it would be nice to at least provide a way for reusing the existing String allocated for the line. A few options:Straight destructuring would require making the fields
pub
, which I would personally be okay with, except for the constraint mentioned above. Justline
being public could work.Line::into_parts -> (PathBuf, String)
could work (and just clone thePath
if/when it becomesArc
'ed).Line::take_line -> String
and panic, or return"".to_string
on future calls to that orLine::line
.impl Into<String> for Line
and just consumeself
to pass alongline
.The text was updated successfully, but these errors were encountered: