Skip to content

Alternative implementation#39

Open
Sorseg wants to merge 1 commit intoakaihola:rust-tsv-sortfrom
Sorseg:rust-tsv-sort
Open

Alternative implementation#39
Sorseg wants to merge 1 commit intoakaihola:rust-tsv-sortfrom
Sorseg:rust-tsv-sort

Conversation

@Sorseg
Copy link

@Sorseg Sorseg commented May 5, 2024

It uses the trick that we don't need to hold on to the last line, since we already have it as a function parameter.


// return the stream position from the counting reader object
Ok(input.stream_position().unwrap())
Ok(input.stream_position().unwrap() - (end.bytes().len() as u64))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a 50% chance that there is an off-by-one error here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it is weird that we write this to the result but still seek backwards as if it is not read from the source. Is this right?

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

Successfully merging this pull request may close these issues.

3 participants