Skip to content

Make the BipBuffer generic over the stored type#12

Open
MatthieuDartiailh wants to merge 2 commits intoutaal:masterfrom
MatthieuDartiailh:generic
Open

Make the BipBuffer generic over the stored type#12
MatthieuDartiailh wants to merge 2 commits intoutaal:masterfrom
MatthieuDartiailh:generic

Conversation

@MatthieuDartiailh
Copy link
Copy Markdown

Closes #11

Let me be honest, it is my first contribution to a Rust project so I may have gotten a bunch of things wrong.

To make the BipBuffer generic I added a generic parameter that needs to be:

  • Sized (I don't see how this could work for unsized types)
  • Send and Sync: this I am not completely sure but I think they are needed to make things well behaved

When creating a buffer from a length the type needs to implement Default and Clone.

All tests compile unmodified and I duplicated them all to run on u64. It may make sense to add a dependency on rstest to avoid duplicating everything.

I did not touch the docs but I will do it after a first round of review.

The type needs to be Sized. It is also required to be Send and Sync for the time being. To create a bip buffer from a length we also require Default and Clone.
@MatthieuDartiailh
Copy link
Copy Markdown
Author

Travis did not trigger on this PR is it normal ?

@utaal
Copy link
Copy Markdown
Owner

utaal commented Sep 25, 2024

Hi @MatthieuDartiailh! Thanks for the PR, I'll take a look as soon as I can, but it may take a few days.

@MatthieuDartiailh
Copy link
Copy Markdown
Author

Friendly ping @utaal

1 similar comment
@MatthieuDartiailh
Copy link
Copy Markdown
Author

Friendly ping @utaal

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.

Generic type support

2 participants