Skip to content

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented May 28, 2025

It seems a new version of Rust borked CI.

error: this can be `std::io::Error::other(_)`
   --> runtime/src/storage/iouring.rs:240:17
    |
240 |                 IoError::new(ErrorKind::Other, e),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
    = note: `-D clippy::io-other-error` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::io_other_error)]`
help: use `std::io::Error::other`
    |
240 -                 IoError::new(ErrorKind::Other, e),
240 +                 IoError::other(e),
    |

error: this can be `std::io::Error::other(_)`
   --> runtime/src/storage/iouring.rs:260:25
    |
260 |                         IoError::new(ErrorKind::Other, "failed to send work"),
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
help: use `std::io::Error::other`
    |
260 -                         IoError::new(ErrorKind::Other, "failed to send work"),
260 +                         IoError::other("failed to send work"),
    |

error: this can be `std::io::Error::other(_)`
   --> runtime/src/storage/iouring.rs:269:21
    |
269 |                     IoError::new(ErrorKind::Other, "failed to read result"),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
help: use `std::io::Error::other`
    |
269 -                     IoError::new(ErrorKind::Other, "failed to read result"),
269 +                     IoError::other("failed to read result"),
    |

error: this can be `std::io::Error::other(_)`
   --> runtime/src/storage/iouring.rs:281:21
    |
281 |                     IoError::new(ErrorKind::Other, format!("error code: {}", return_value)),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
help: use `std::io::Error::other`
    |
281 -                     IoError::new(ErrorKind::Other, format!("error code: {}", return_value)),
281 +                     IoError::other(format!("error code: {}", return_value)),
    |

    Checking time-core v0.1.3
error: could not compile `commonware-runtime` (lib) due to 4 previous errors

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses Clippy lint errors by replacing direct calls to IoError::new(ErrorKind::Other, …) with the more idiomatic IoError::other(…).

  • Replaces multiple IoError::new(ErrorKind::Other, …) invocations with IoError::other(…).
  • Consolidates error construction into single-line calls.
Comments suppressed due to low confidence (1)

runtime/src/storage/iouring.rs:237

  • Consider adding a unit test to exercise the truncate error path (e.g., when set_len fails) to ensure the new IoError::other mapping behaves as expected.
Error::BlobTruncateFailed(self.partition.clone(), hex(&self.name), IoError::other(e))

@patrick-ogrady patrick-ogrady requested a review from Copilot May 28, 2025 20:02
@patrick-ogrady patrick-ogrady marked this pull request as ready for review May 28, 2025 20:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses Clippy lint io_other_error by replacing IoError::new(ErrorKind::Other, …) calls with the more concise IoError::other(…).

  • Update truncate error construction to use IoError::other.
  • Update various Blob sync error cases to use IoError::other.

@patrick-ogrady patrick-ogrady requested a review from Copilot May 28, 2025 20:12
@patrick-ogrady patrick-ogrady changed the title [CI] Fix Lint Error on main [CI] Fix IoError Lint Error on main May 28, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes CI lint errors in the iouring storage module by updating error instantiation to use the newly introduced IoError::other variant instead of IoError::new with ErrorKind::Other.

  • Removed the unused ErrorKind import.
  • Updated error instantiation in Blob methods to conform with Clippy's recommendations.

@patrick-ogrady patrick-ogrady changed the title [CI] Fix IoError Lint Error on main [CI] Fix IoError Lint Issue on main May 28, 2025
@patrick-ogrady patrick-ogrady merged commit 1e8a9f9 into main May 28, 2025
13 checks passed
@patrick-ogrady patrick-ogrady deleted the fix-lint-error branch May 28, 2025 20:14
Copy link

codecov bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.79%. Comparing base (9cc792b) to head (d5e659e).
Report is 2 commits behind head on main.

@@           Coverage Diff           @@
##             main    #1009   +/-   ##
=======================================
  Coverage   90.79%   90.79%           
=======================================
  Files         190      190           
  Lines       52632    52632           
=======================================
  Hits        47789    47789           
  Misses       4843     4843           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9cc792b...d5e659e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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