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: Add alternative methods, so Bytes is not required #19

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

Norbiros
Copy link
Member

Fixes: #17

This solution, while not perfect, enables full utilization of CrabNBT without needing to include bytes crate in your project.

In future, I'll redesign this to improve performance (writing directly to Vec instead of serializing bytes and then pushing it) and usability, but this will require changes to public methods and a new major version (see #18 for details).

@Norbiros Norbiros requested a review from SzczurekYT September 18, 2024 15:08
@SzczurekYT
Copy link
Contributor

So this just adds wrapper functions around current code which still use bytes right?

Copy link
Contributor

@SzczurekYT SzczurekYT left a comment

Choose a reason for hiding this comment

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

Do not call a Vec cursor, because it is not a cursor.

@Norbiros Norbiros force-pushed the feat/make-bytes-optional branch from 1668265 to a598c78 Compare September 18, 2024 15:26
@Norbiros
Copy link
Member Author

So this just adds wrapper functions around current code which still use bytes right?

Yes, it's fine to use bytes. The problem was that if you wanted to interact with those methods in CrabNBT, you had to add bytes to your project. Now you can use temporary wrapper functions. Probably even in v1.0.0 we'll use bytes under the hood.

@Norbiros Norbiros requested a review from SzczurekYT September 18, 2024 15:27
@SzczurekYT
Copy link
Contributor

but this will require changes to public methods and a new major version (see #18 for details).

No, that is wrong.
From semver spec

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

Until we release 1.0.0 we are allowed to break public api if needed.

@Norbiros
Copy link
Member Author

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

Until we release 1.0.0 we are allowed to break public api if needed.

Have fun fixing breaking changes in minor updates. That is just frustrating, even if semver spec allows. Most of libraries that we use in CC are below 1.0.0 and CrabCraft will be until we achieve complete vanilla compatibility :3

@Norbiros Norbiros merged commit e3a8d5e into main Sep 19, 2024
2 checks passed
@Norbiros Norbiros deleted the feat/make-bytes-optional branch September 19, 2024 15:42
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.

Does this crate have to use Bytes crate?
2 participants