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 'unreachable' warnings in ParsedLogPath #375

Merged

Conversation

zachschuermann
Copy link
Collaborator

warnings happened before when we did cargo t -p delta_kernel. this PR just uses developer-visibility and adds a few #[allow(unused)]/ dead code

   Compiling delta_kernel v0.3.1 (/Users/zach.schuermann/dev/delta-kernel-rs/kernel)
warning: fields `filename` and `extension` are never read
  --> kernel/src/path.rs:45:9
   |
43 | struct ParsedLogPath<Location: AsUrl = FileMeta> {
   |        ------------- fields in this struct
44 |     pub location: Location,
45 |     pub filename: String,
   |         ^^^^^^^^
46 |     pub extension: String,
   |         ^^^^^^^^^
   |
   = note: `ParsedLogPath` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: method `is_unknown` is never used
   --> kernel/src/path.rs:159:12
    |
74  | impl<Location: AsUrl> ParsedLogPath<Location> {
    | --------------------------------------------- method in this implementation
...
159 |     pub fn is_unknown(&self) -> bool {
    |            ^^^^^^^^^^

warning: unreachable `pub` item
  --> kernel/src/path.rs:76:5
   |
76 |     pub fn try_from(location: Location) -> DeltaResult<Option<ParsedLogPath<Location>>> {
   |     ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |     |
   |     help: consider restricting its visibility: `pub(crate)`
   |
note: the lint level is defined here
  --> kernel/src/lib.rs:46:5
   |
46 |     unreachable_pub,
   |     ^^^^^^^^^^^^^^^

warning: unreachable `pub` item
   --> kernel/src/path.rs:147:5
    |
147 |     pub fn is_commit(&self) -> bool {
    |     ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |
    |     help: consider restricting its visibility: `pub(crate)`

warning: unreachable `pub` item
   --> kernel/src/path.rs:151:5
    |
151 |     pub fn is_checkpoint(&self) -> bool {
    |     ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |
    |     help: consider restricting its visibility: `pub(crate)`

warning: unreachable `pub` item
   --> kernel/src/path.rs:159:5
    |
159 |     pub fn is_unknown(&self) -> bool {
    |     ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |
    |     help: consider restricting its visibility: `pub(crate)`

warning: `delta_kernel` (lib) generated 6 warnings (run `cargo fix --lib -p delta_kernel` to apply 4 suggestions)
warning: `delta_kernel` (lib test) generated 4 warnings (4 duplicates)

Copy link
Collaborator

@scovich scovich left a comment

Choose a reason for hiding this comment

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

Thanks for figuring this out!

kernel/src/path.rs Outdated Show resolved Hide resolved
kernel/src/path.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.86%. Comparing base (0fdb40a) to head (9b34c55).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #375      +/-   ##
==========================================
+ Coverage   76.54%   76.86%   +0.32%     
==========================================
  Files          47       47              
  Lines        9384     9436      +52     
  Branches     9384     9436      +52     
==========================================
+ Hits         7183     7253      +70     
+ Misses       1799     1789      -10     
+ Partials      402      394       -8     

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

Copy link
Collaborator

@nicklan nicklan left a comment

Choose a reason for hiding this comment

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

yeah thanks, this was on my list of paper cuts to fix

@zachschuermann zachschuermann merged commit 86ffe02 into delta-io:main Oct 7, 2024
12 checks passed
@zachschuermann zachschuermann deleted the fix-parsedlogpath-warnings branch October 7, 2024 23:17
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