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

Quell warnings by removing unused Struct fields #166

Merged
merged 1 commit into from
Mar 15, 2025

Conversation

blairconrad
Copy link
Contributor

When git-absorb is built, we're beset by warnings:

warning: field `trailing_newline` is never read
  --> src/owned.rs:54:9
   |
51 | pub struct Block {
   |            ----- field in this struct
...
54 |     pub trailing_newline: bool,
   |         ^^^^^^^^^^^^^^^^
   |
   = note: `Block` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: fields `old_id` and `new_id` are never read
   --> src/owned.rs:209:9
    |
207 | pub struct Patch {
    |            ----- fields in this struct
208 |     pub old_path: Vec<u8>,
209 |     pub old_id: git2::Oid,
    |         ^^^^^^
210 |     pub new_path: Vec<u8>,
211 |     pub new_id: git2::Oid,
    |         ^^^^^^
    |
    = note: `Patch` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: `git-absorb` (lib) generated 2 warnings

Removing a few unused fields quiets them right up.

@tummychow tummychow merged commit 0befc3f into tummychow:master Mar 15, 2025
5 checks passed
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