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

Fix all warnings from the compiler #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

campbellC
Copy link

I wanted to get a feel for the repo so decided to fix the compile-time warnings.

  • Replace assert_eq!(1,0); std::mem::uninitialized with a panic!. I've also wrapped this in a macro to avoid the boilerplate.
  • Minor fix ups to Result's not being used in tests
  • Ran cargo fmt - hence the many whitespace changes, apologies if this is noisy I can resubmit as two separate commits if it will help readability.
  • One of the warnings I think was actually a bug - a cgroup builder could fail to
    apply resource constraints but still return a Cgroup silently. Now a
    builder will return an Error correctly in this case - this is an API
    change though so requires a mv bump.

This change simply fixes all the warnings from the latest version of the
compiler. It also removes the (non-test code) unsafe blocks. One of the
warnings I think was actually a bug - a cgroup builder could fail to
apply resource constraints but still return a Cgroup silently. Now a
builder will return an Error correctly in this case - this is an API
change though so requires a mv bump.
liubin added a commit to liubin/cgroups-rs that referenced this pull request Sep 23, 2020
And in Travis CI, treat warnings as error
to keep from merging codes with warning.

Fixes: levex#13

Signed-off-by: bin liu <[email protected]>
liubin added a commit to liubin/cgroups-rs that referenced this pull request Sep 23, 2020
And in Travis CI, treat warnings as error
to keep from merging codes with warning.

Fixes: levex#13

Signed-off-by: bin liu <[email protected]>
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.

None yet

1 participant