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

bytes 0.5 compatibility #42

Closed
Fabian-Gruenbichler opened this issue Feb 9, 2020 · 3 comments
Closed

bytes 0.5 compatibility #42

Fabian-Gruenbichler opened this issue Feb 9, 2020 · 3 comments

Comments

@Fabian-Gruenbichler
Copy link
Contributor

I'm currently in the process of updating packaged crates for futures 0.3/tokio 0.2 compatibility in Debian, which also entails updating to bytes 0.5.

Unfortunately bytes 0.4->0.5 does entail some breaking changes, and bcder's Captured/CapturedWriter are affected as well:

call in Captured::extend

error[E0599]: no method named `extend_from_slice` found for type `&'a mut bytes::bytes::Bytes` in the current scope
   --> src/captured.rs:197:16
    |
197 |         self.0.extend_from_slice(buf);
    |                ^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `clone_from_slice`

I am not sure whether this means that Captured needs to switch over to BytesMut or whether there is a simpler solution. tokio-rs/bytes#368 and tokio-rs/bytes#350 might also be related.

Fabian-Gruenbichler pushed a commit to Fabian-Gruenbichler/bcder that referenced this issue Feb 9, 2020
captured.rs is still broken, see NLnetLabs#42

Signed-off-by: Fabian Grünbichler <[email protected]>
@partim
Copy link
Member

partim commented Feb 10, 2020

Just switching to BytesMut won’t do, since then there will be lots of copying on cloning – Captured currently promises cheap copies. We might have to have a separate CapturedMut, but I need to look at the code that uses this stuff to see how awkward that would be.

@Fabian-Gruenbichler
Copy link
Contributor Author

Obviously you know your code base better than me, and I am happy if I don't have to dig in further and can leave it in your hands instead :) it will probably take at least a few weeks until this actual starts to block anything on the Debian side, so no need to hurry (yet ;-) ).

Fabian-Gruenbichler pushed a commit to Fabian-Gruenbichler/bcder that referenced this issue Feb 10, 2020
captured.rs is still broken, see NLnetLabs#42

Signed-off-by: Fabian Grünbichler <[email protected]>
Fabian-Gruenbichler pushed a commit to Fabian-Gruenbichler/bcder that referenced this issue Mar 5, 2020
captured.rs is still broken, see NLnetLabs#42

Signed-off-by: Fabian Grünbichler <[email protected]>
@partim
Copy link
Member

partim commented Mar 5, 2020

This is now solved via #43, #46, and #47.

@partim partim closed this as completed Mar 5, 2020
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

2 participants