Skip to content

Commit

Permalink
style/font: don't warn on dead code
Browse files Browse the repository at this point in the history
The second String is not used anywhere so the Rust compiler
will complain:

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
  • Loading branch information
10ne1 committed Jun 23, 2024
1 parent 16714cf commit 281d8ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plotters/src/style/font/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl std::fmt::Display for FontError {
impl std::error::Error for FontError {}

#[derive(Clone)]
#[allow(dead_code)]
pub struct FontDataInternal(String, String);

impl FontData for FontDataInternal {
Expand Down

0 comments on commit 281d8ad

Please sign in to comment.