Conversation
…nterval, zero-div checks, remove duplicate comment
There was a problem hiding this comment.
Gitzilla has reviewed your changes and found 1 potential issue.
Autofix is OFF. To automatically fix reported issues, enable autofix in the Gitzilla dashboard.
Comment on lines
+144
to
+146
| #[test] | ||
| fn test_validate_price_invalid() { | ||
| assert!(validate_price(-10.0).is_err()); |
There was a problem hiding this comment.
Duplicate test function causes compilation failure
High Severity
The test_validate_price_invalid test function is duplicated and has an orphaned statement. Lines 144-149 now contain:
#[test]
fn test_validate_price_invalid() {
#[test]
fn test_validate_price_invalid() {
assert!(validate_price(-10.0).is_err());
assert!(validate_price(-10.0).is_err());
This causes a "function defined multiple times" error and the orphaned assert! outside any function body will fail to compile.
Suggested fix: Remove the duplicate lines. The test should have only one function declaration and one assertion for -10.0. Keep the existing assertions for f64::NAN and f64::INFINITY.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
price_aggregatestable to database.rs initializationThese fixes address the valid findings from the code scan.
Note
Low Risk
Overview
This pull request adds the missing
price_aggregatestable creation to the database initialization insrc/database.rs. It updatessrc/shanghai_price_service.rsto read theUPDATE_INTERVAL_SECONDSvalue from an environment variable instead of a hard‑coded constant. Insrc/bot.rs, it inserts a zero‑check before division operations in conversion calculations and removes a duplicate comment. Additionally, it introduces a new GitHub Actions workflow file at.github/workflows/test.ymlto configure testing.Written by Gitzilla for commit 255240b. This will update automatically on new runs. Configure in the Gitzilla dashboard.