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 unused field warning in cursor parsing #915

Merged
merged 1 commit into from
Feb 4, 2024
Merged

Fix unused field warning in cursor parsing #915

merged 1 commit into from
Feb 4, 2024

Conversation

psychon
Copy link
Owner

@psychon psychon commented Feb 3, 2024

Rust nightly started to warn about an unused field while building examples:

warning: field `0` is never read
  --> x11rb/src/cursor/parse_cursor.rs:18:8
   |
18 |     Io(std::io::Error),
   |     -- ^^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
   = note: `#[warn(dead_code)]` on by default

The code from x11rb::cursor::parse_cursor is only called from x11rb::cursor::load_cursor(). This code completely ignores any errors and turns them into ParseError::InvalidValue. Thus, this warning is right.

Copy link

Choose a reason for hiding this comment

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

⚠️ [clippy] reported by reviewdog 🐶

warning: unused import: `ErrorKind`
   --> x11rb/src/cursor/parse_cursor.rs:194:27
    |
194 |     use std::io::{Cursor, ErrorKind};
    |                           ^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

Rust nightly started to warn about an unused field while building
examples:

    warning: field `0` is never read
      --> x11rb/src/cursor/parse_cursor.rs:18:8
       |
    18 |     Io(std::io::Error),
       |     -- ^^^^^^^^^^^^^^
       |     |
       |     field in this variant
       |
       = note: `#[warn(dead_code)]` on by default

The code from x11rb::cursor::parse_cursor is only called from
x11rb::cursor::load_cursor(). This code completely ignores any errors
and turns them into ParseError::InvalidValue. Thus, this warning is
right.

Signed-off-by: Uli Schlachter <[email protected]>
Copy link

codecov bot commented Feb 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0fbfd89) 13.06% compared to head (64a515d) 13.06%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #915   +/-   ##
=======================================
  Coverage   13.06%   13.06%           
=======================================
  Files         190      190           
  Lines      136667   136663    -4     
=======================================
  Hits        17859    17859           
+ Misses     118808   118804    -4     
Flag Coverage Δ
tests 13.06% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@notgull notgull left a comment

Choose a reason for hiding this comment

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

Thanks!

@mergify mergify bot merged commit 55e63f5 into master Feb 4, 2024
23 checks passed
@mergify mergify bot deleted the fix_warning branch February 4, 2024 18:12
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