Skip to content

refactor: Add clippy no panic lints#1663

Merged
gold-silver-copper merged 5 commits into0xPlaygrounds:mainfrom
gold-silver-copper:codex/panic-free-direction
Apr 24, 2026
Merged

refactor: Add clippy no panic lints#1663
gold-silver-copper merged 5 commits into0xPlaygrounds:mainfrom
gold-silver-copper:codex/panic-free-direction

Conversation

@gold-silver-copper
Copy link
Copy Markdown
Contributor

@gold-silver-copper gold-silver-copper commented Apr 24, 2026

Summary

  • Adds workspace clippy lints for panic-prone code paths: unwrap_used, expect_used, panic, unreachable, indexing_slicing, and async lock/refcell awaits.
  • Makes ProviderClient::from_env and ProviderClient::from_val return Result.
  • Replaces runtime panics in provider/client/vector-store code with typed errors where practical.

Breaking Changes

  • ProviderClient::from_env() now returns Result<Self, Self::Error>.
    Migration: Client::from_env() -> Client::from_env()? or explicit error handling.
  • ProviderClient::from_val(...) now returns Result<Self, Self::Error>.
  • Some integration constructors, including fastembed model builders, now return Result.

Notes

  • Panic lints are broadly allowed in many test modules; this PR primarily hardens library/runtime code.
  • Some APIs that cannot return Result, such as EmbeddingModel::make, now defer unsupported-construction failures to use time.

Verification

  • cargo fmt --check
  • cargo clippy --all-targets --all-features
  • cargo test

@gold-silver-copper gold-silver-copper added this pull request to the merge queue Apr 24, 2026
Merged via the queue into 0xPlaygrounds:main with commit 6ea80be Apr 24, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 24, 2026
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.

1 participant