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

feat: make file-related APIs compatible with io::Cursor #121

Merged

Conversation

davidepedranz
Copy link
Contributor

The codebase defines a StorageFile trait to model anything similar to a file. By using impl StorageFile instead of fs::File in the API signatures, users are able to provide either a file or something similar (for example, io::Cursor to manipulate a block of data in memory).

This commit updates the APIs still using fs::File to impl StorageFile.

@davidepedranz
Copy link
Contributor Author

A few tests (tag::tests::aiff_read_and_write and tag::tests::test_issue_39) are failing, but they were failing on both the latest commit on main and the latest commit in v1.10.0. They are 99% unrelated to this change. Also, this change should break compilation if anything, not really change the code behaviour.

@davidepedranz
Copy link
Contributor Author

Thanks a lot for creating this library: I found it very easy and convenient to use!

If you are open to contributions, I have a few additional PR to open to add support for some other v2.4 frames (TPOS, TDRL) 🙏🏼

@davidepedranz davidepedranz force-pushed the feat/io-cursor-compatibility branch from 009f325 to 4d52e07 Compare December 25, 2023 13:39
@davidepedranz
Copy link
Contributor Author

^ reformatted the file, for some reason cargo fmt didn't run automatically in my IDE

@polyfloyd
Copy link
Owner

Thanks! Will have a look later this week :)

src/tag.rs Outdated Show resolved Hide resolved
The codebase defines a StorageFile trait to model anything similar to a file.
By using `impl StorageFile` instead of `fs::File` in the API signatures, users
are able to provide either a file or something similar (for example, `io::Cursor`
to manipulate a block of data in memory).

This commit updates the APIs still using `fs::File` to `impl StorageFile`.
@davidepedranz davidepedranz force-pushed the feat/io-cursor-compatibility branch from 4d52e07 to bb1ce6c Compare December 27, 2023 00:18
@polyfloyd polyfloyd merged commit 4586dd0 into polyfloyd:main Dec 27, 2023
3 checks passed
@polyfloyd
Copy link
Owner

Nice work!

And also, I am always happy to receive contributions to implement support for more frame types :)

@davidepedranz
Copy link
Contributor Author

Thanks for the quick review and merging this change, @polyfloyd!

And also, I am always happy to receive contributions to implement support for more frame types :)

Amazing! I will work on adapting the code (currently, I am extending your library with external functions) and submit a few other PRs in the next few days.

@davidepedranz davidepedranz deleted the feat/io-cursor-compatibility branch December 27, 2023 09:54
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.

2 participants