There are a fair few changes here, but they are all mostly surface level.
Here are the highlights:
Bumped the version of darknet.
Looking over the commit messages there should be no breaking changes,
made edition = 2021.
This has the drawback of requiring a newer compiler, this library currently states a MSRV of 1.43.0. I figured with a minor version bump this should be okay considering the library is 0.x.x and 1.43.0 is now 2 and a bit years old now.
Minor fixes.
removed unneeded lifetime annotations.
removed some duplicated code around error handling with path_to_cstring.
some use of equivalent but clearer functions (such as map_or in instead of map followed by unwrap_or).
removed uneeded unsafe from get_raw_data.
some documentation changes.
I can split this into multiple PR's if you would prefer, each commit builds separately so it would be no issue.
Also to note is that there is some code that can lead to UB in safe code. get_data_mut returns a mutable reference from a shared reference. Clippy caught this and the reasoning for this being unsafe can be found here. The fix for this is to have get_data_mut take a mutable reference to self. This however is a breaking API change so I figured it does not fit in the scope of this PR.
There are a fair few changes here, but they are all mostly surface level.
Here are the highlights:
edition = 2021
.Minor fixes.
path_to_cstring
.map_or
in instead ofmap
followed byunwrap_or
).get_raw_data
.I can split this into multiple PR's if you would prefer, each commit builds separately so it would be no issue.
Also to note is that there is some code that can lead to UB in safe code.
get_data_mut
returns a mutable reference from a shared reference. Clippy caught this and the reasoning for this being unsafe can be found here. The fix for this is to haveget_data_mut
take a mutable reference to self. This however is a breaking API change so I figured it does not fit in the scope of this PR.