chore(gas_price_service): minor refactors to make the code more readable #2636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linked Issues/PRs
Description
AI generated pr desc:
This pull request includes various changes to improve code readability, simplify logic, and ensure consistency across the
gas_price_service
module. The most important changes include refactoring trait bounds, updating method calls, and improving error handling.Refactoring trait bounds:
crates/services/gas_price_service/src/common/fuel_core_storage_adapter.rs
: Combined multiple trait bounds into single lines for better readability. [1] [2] [3]Updating method calls:
crates/services/gas_price_service/src/v0/service.rs
: Removed unnecessaryasync
from theset_metadata
method and updated its calls accordingly. [1] [2] [3]Improving error handling:
crates/services/gas_price_service/src/v0/uninitialized_task.rs
: Replacedok_or
withok_or_else
for better performance.crates/services/gas_price_service/src/v1/da_source_service/block_committer_costs.rs
: Updated error handling to useok_or_else
and improved iterator logic. [1] [2]Consistency improvements:
crates/services/gas_price_service/src/common/updater_metadata.rs
: Replaced enum variant names withSelf
for consistency.crates/services/gas_price_service/src/v1/uninitialized_task.rs
: Unified the handling of optional values usingmap_or
andmap_or_else
for clarity. [1] [2] [3]These changes collectively enhance the maintainability and performance of the
gas_price_service
module.Checklist
Before requesting review