Skip to content

Fix #3 - add in-memory API's. #4

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

Merged
merged 2 commits into from
Jun 2, 2025

Conversation

finnbear
Copy link
Contributor

@finnbear finnbear commented Jun 1, 2025

Fixes #3, along with the (roughly) minimum cleanup and documentation needed.

I might clean up some other things in a separate PR.

@alvinometric
Copy link
Owner

alvinometric commented Jun 2, 2025

Hello,
Thanks for the PR! Any chance you could revert this 1a9d017 ?

I'm not sure how it's related?

@finnbear
Copy link
Contributor Author

finnbear commented Jun 2, 2025

I believe it is essential, because otherwise there is no way to create that struct when writing IPTC metadata from scratch.

I guess, strictly speaking, this is an orthogonal concern to memory vs. filesystem, so I could move it to a separate PR.

@alvinometric
Copy link
Owner

OK cool, are you sure you need [u8] ? In #3 you're mentioning that you want to read the buffer as Vec<u8>?

@finnbear
Copy link
Contributor Author

finnbear commented Jun 2, 2025

As a matter of idiomatic Rust, the public API should be &[u8] even if I personally have a Vec<u8> because, e.g., someone might have borrowed bytes from a zero-copy deserializer. Passing &mut Vec<_> is fine but &Vec<_> is an anti-pattern. I then had to change it in other places to make the library compile.

@alvinometric
Copy link
Owner

Great, can you update the issue ? Then we're good

@finnbear
Copy link
Contributor Author

finnbear commented Jun 2, 2025

I'm not entirely sure what you mean, as &[u8] is a standard way of read-only access to data stored in a Vec<u8>, but I edited the issue description to mention &[u8] :)

@alvinometric alvinometric merged commit 86a97c1 into alvinometric:main Jun 2, 2025
1 check passed
@alvinometric
Copy link
Owner

@finnbear Now available in v0.3.0

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.

Feature request: in-memory reading/writing of IPTC
2 participants