Skip to content

refactor(programs): use if let Some instead of unwrap for not is_none#10069

Merged
kskalski merged 1 commit intoanza-xyz:masterfrom
kskalski:ks/clippy_unwrap
Jan 16, 2026
Merged

refactor(programs): use if let Some instead of unwrap for not is_none#10069
kskalski merged 1 commit intoanza-xyz:masterfrom
kskalski:ks/clippy_unwrap

Conversation

@kskalski
Copy link
Copy Markdown

Problem

The code in process_loader_upgradeable_instruction( is checking option twice:

if x.is_none() {  // here
} else {
   ... x.unwrap()  // again here
} 

Summary of Changes

Flip if branches such that if let Some(x) = x can be used instead

Note: this was caught with newer (1.92) rust toolchain and emits warning, which this PR is fixing

@mergify
Copy link
Copy Markdown

mergify Bot commented Jan 16, 2026

The Firedancer team maintains a line-for-line reimplementation of the
native programs, and until native programs are moved to BPF, those
implementations must exactly match their Agave counterparts.
If this PR represents a change to a native program implementation (not
tests), please include a reviewer from the Firedancer team. And please
keep refactors to a minimum.

@kskalski kskalski marked this pull request as ready for review January 16, 2026 10:51
@kskalski kskalski requested a review from a team as a code owner January 16, 2026 10:51
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.6%. Comparing base (4065e4a) to head (284bd21).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10069   +/-   ##
=======================================
  Coverage    82.6%    82.6%           
=======================================
  Files         844      844           
  Lines      316607   316607           
=======================================
+ Hits       261552   261565   +13     
+ Misses      55055    55042   -13     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kskalski kskalski added this pull request to the merge queue Jan 16, 2026
Merged via the queue into anza-xyz:master with commit 2546caf Jan 16, 2026
47 checks passed
@kskalski kskalski deleted the ks/clippy_unwrap branch January 16, 2026 11:41
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