a1ien / rusb

A safe Rust wrapper for libusb.
Other
382 stars 78 forks source link

Use &self reference for all DeviceHandle methods #186

Closed surban closed 5 months ago

surban commented 8 months ago

Change the following methods to accept a non-exclusive reference:

This is safe to do because libusb is thread-safe.

Fixes #148

a1ien commented 8 months ago

I am okay to accept shared reference instead of mut ref. Give me a couple of day to think and also check if it breaking change or not.

surban commented 8 months ago

Give me a couple of day to think and also check if it breaking change or not.

My impression is that changing from &mut self to &self should not be a breaking change. However, I am not 100% sure and it will most likely produce "unnecessary mut" warnings in user code.

surban commented 5 months ago

Hi.

Is there anything I can do to help getting this merged?

a1ien commented 5 months ago

Sorry forgot. Merged.

surban commented 5 months ago

Great, thank you!

Would you mind doing a release in the coming days? I would like to publish an update to a crate that depends on this functionality.

a1ien commented 5 months ago

I realize that we have new version of libusb(1.0.27). So i try to update all.