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

netdog: add attribute to ignore compiler dead-code warning #1949

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Feb 9, 2022

Issue number:
N/A

Description of changes:
Compiling netdog with rust v1.58.1 gives a compiler warning about dead_code in netdog.

Author: Erikson Tung <etung@amazon.com>
Date:   Wed Feb 9 15:11:25 2022 -0800

    netdog: add attribute to ignore compiler dead-code warning
    
    We want to store fields from a DHCP lease, even if we don't necessary
    need to use all the fields right now.

Testing done:
Before the change, when we compile:

warning: field is never read: `dns_domain`
  --> api/netdog/src/main.rs:57:5
   |
57 |     dns_domain: Option<String>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: `netdog` (bin "netdog") generated 1 warning

After the change:
No more compiler warnings in netdog.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

We want to store fields from a DHCP lease, even if we don't necessary
need to use all the fields right now.
@etungsten etungsten requested review from zmrow and webern February 9, 2022 23:14
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we probably still want to keep this field - lgtm!

🦺

@etungsten etungsten merged commit aeec3aa into bottlerocket-os:develop Feb 10, 2022
@etungsten etungsten deleted the dead-code-warning branch February 10, 2022 17:24
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.

3 participants