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

actionkv1 position for insert #68

Open
jflasche opened this issue Jan 2, 2022 · 0 comments
Open

actionkv1 position for insert #68

jflasche opened this issue Jan 2, 2022 · 0 comments

Comments

@jflasche
Copy link

jflasche commented Jan 2, 2022

Hi Tim,

in code/ch7/ch7-actionkv1/src/lib.rs line 196..=198:
let next_byte = SeekFrom::End(0);
let current_position = f.seek(SeekFrom::Current(0))?;
f.seek(next_byte)?;

current_position does not necessarily reflects the end of the file, but a new record should always go to the end.

so, shouldn't it be just simple a one line:
let current_position = f.seek(SeekFrom::End(0))?;

Thanks for clarification
Jens

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