Skip to content

Commit

Permalink
Fix CI 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jgcrosta committed Mar 15, 2024
1 parent d3c9eb4 commit 86c18fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion detectors/unused-return-enum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ impl<'tcx> LateLintPass<'tcx> for UnusedReturnEnum {

walk_expr(&mut visitor, body.value);

if !visitor.found_return && (visitor.count_err == 0 || visitor.count_ok == 0) {
if !visitor.found_return
&& !visitor.found_try
&& (visitor.count_err == 0 || visitor.count_ok == 0)
{
visitor.span.iter().for_each(|span| {
Detector::UnusedReturnEnum.span_lint_and_help(
cx,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![no_std]

use soroban_sdk::{contract, contracterror, contractimpl, testutils::arbitrary::arbitrary::Result};
use soroban_sdk::{contract, contracterror, contractimpl};

#[contract]
pub struct UnusedReturnEnum;
Expand All @@ -17,8 +17,8 @@ pub enum Error {
impl UnusedReturnEnum {
/// Returns the percentage difference between two values.
pub fn get_percentage_difference(balance1: u128, balance2: u128) -> Result<u128, Error> {
let absolute_difference = value1.abs_diff(value2);
let sum = value1 + value2;
let absolute_difference = balance1.abs_diff(balance2);
let sum = balance1 + balance2;
let result = 100u128
.checked_mul(absolute_difference / sum)
.ok_or(Error::Overflow)?;
Expand Down

0 comments on commit 86c18fe

Please sign in to comment.