-
Notifications
You must be signed in to change notification settings - Fork 6
refactor: cleanup and changes to satisfy Clippy #57
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for the effort here, its definitely appreciated and needed as we transition this from more research oriented code to stable code.
|
b04f77a to
e9f2dd8
Compare
e9f2dd8 to
63459d4
Compare
0787c8a to
428847d
Compare
|
There are a few areas with a mutable reference is returned from a function which doesn't get a mutable reference to Maybe this isn't a big deal since it's already So this can be made mutable, or we can whitelist such Clippy concerns. |
|
Hmm lets try having it accept a mutable reference to self and see if that causes any major issues, given that its a public interface we should probably try to adopt standard rust design patterns |
81fc6b2 to
69adb1e
Compare
81d22ea to
ac4320b
Compare
|
What are your thoughts on this PR? I know it's pretty big, but it does make decent progress towards Clippy:
Some fixes are to whitelist some Clippy warnings/errors because the changes would drastically change the API, such as functions returning mutable references have to take a mutable reference to the object. Additionally, this does remove the extra bool for serialization but doesn't address the dual serialization (serialize to get the size, allocate, serialize again into the buffer). Clippy has been useful and reduced some unneeded casts and clones. |
|
This looks all good to me! One thing I've ran into in testing is for more complicated tests debug is too slow, so I test in release mode often. Do you know if we can create a new profile like profile.rel_debug or something that enables the debug_asserts while also keeping the release performance optimizations? |
|
It seems you can by specifying https://doc.rust-lang.org/beta/cargo/reference/profiles.html#debug-assertions I changed some of those assert statements to try to make the release mode faster, but wasn't aware of the slow debug issue. I like the "release debug" profile idea. |
* This does involve some API changes (function renames) Signed-off-by: Richard Zak <[email protected]>
I've been working on addressing Clippy warnings and this ended up being bigger than I expected and there are still a lot of unaddressed warnings/errors.
So I've got some questions:
tracingcrate andinfo!()ortrace!()macros.cargo fmtdefaults sufficient?.unwrap()s?Tests should still pass, the ones which fail (25 of them at the end) are because the script seems to not find the release compiled examples, despite me compiling them and the other tests being able to use them.