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

style/font: use web font style #602

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

10ne1
Copy link
Contributor

@10ne1 10ne1 commented Jun 23, 2024

style/font: use web font style

The font-style is actually useful so let's set it.

@AaronErhardt
Copy link
Member

Since this appears to be an internal API I think we should rather fix the warning by removing the unnecessary field instead of suppressing the warning. Or is there a reason why we need the second field?

The second String is not used anywhere so the Rust compiler
will complain like below.

The font-style is actually useful so let's set it.

warning: field `1` is never read
  -->
  /home/adi/workspace/web/deps/plotters/plotters/src/style/font/web.rs:21:37
     |
  21 | pub struct FontDataInternal(String, String);
     |            ----------------         ^^^^^^
     |            field in this struct
     |
     = note: `FontDataInternal` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
     = note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
     |
  21 | pub struct FontDataInternal(String, ());
     |                                     ~~

warning: `plotters` (lib) generated 1 warning
@10ne1 10ne1 force-pushed the dev/aratiu/silence-warning branch from 281d8ad to 70b78b6 Compare June 24, 2024 21:24
@10ne1 10ne1 changed the title style/font: don't warn on dead code style/font: use web font style Jun 24, 2024
@10ne1
Copy link
Contributor Author

10ne1 commented Jun 24, 2024

@AaronErhardt I've updated the commit, turns out we actually need that second parametr and we can set it to avoid the warning. Thanks!

Copy link
Member

@AaronErhardt AaronErhardt left a comment

Choose a reason for hiding this comment

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

Thanks!

@AaronErhardt AaronErhardt merged commit 1ca0b7e into plotters-rs:master Jun 25, 2024
18 checks passed
@10ne1 10ne1 deleted the dev/aratiu/silence-warning branch June 25, 2024 12:21
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.

2 participants