Skip to content

BigFloat ln - fix for inputs <=0

Sign in for the full log view
GitHub Actions / clippy failed Jun 19, 2024 in 0s

reviewdog [clippy] report

reported by reviewdog 🐶

Findings (1)

contracts/feature-tests/big-float-features/src/big_float_operators.rs|90 col 9| error[E0308]: mismatched types
--> contracts/feature-tests/big-float-features/src/big_float_operators.rs:90:9
|
89 | fn ln_big_float_ref(&self, a: &BigFloat) -> BigFloat {
| -------- expected multiversx_sc::types::BigFloat<<Self as multiversx_sc::contract_base::ContractBase>::Api> because of return type
90 | a.ln()
| ^^^^^^ expected BigFloat<<... as ContractBase>::Api>, found Option<BigFloat<...>>
|
= note: expected struct multiversx_sc::types::BigFloat<_>
found enum core::option::Option<multiversx_sc::types::BigFloat<_>>
help: consider using Option::expect to unwrap the core::option::Option<multiversx_sc::types::BigFloat<<Self as multiversx_sc::contract_base::ContractBase>::Api>> value, panicking if the value is an Option::None
|
90 | a.ln().expect("REASON")
| +++++++++++++++++

Filtered Findings (0)

Annotations

Check failure on line 90 in contracts/feature-tests/big-float-features/src/big_float_operators.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] contracts/feature-tests/big-float-features/src/big_float_operators.rs#L90

error[E0308]: mismatched types
  --> contracts/feature-tests/big-float-features/src/big_float_operators.rs:90:9
   |
89 |     fn ln_big_float_ref(&self, a: &BigFloat) -> BigFloat {
   |                                                 -------- expected `multiversx_sc::types::BigFloat<<Self as multiversx_sc::contract_base::ContractBase>::Api>` because of return type
90 |         a.ln()
   |         ^^^^^^ expected `BigFloat<<... as ContractBase>::Api>`, found `Option<BigFloat<...>>`
   |
   = note: expected struct `multiversx_sc::types::BigFloat<_>`
                found enum `core::option::Option<multiversx_sc::types::BigFloat<_>>`
help: consider using `Option::expect` to unwrap the `core::option::Option<multiversx_sc::types::BigFloat<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` value, panicking if the value is an `Option::None`
   |
90 |         a.ln().expect("REASON")
   |               +++++++++++++++++
Raw output
contracts/feature-tests/big-float-features/src/big_float_operators.rs:90:9:e:error[E0308]: mismatched types
  --> contracts/feature-tests/big-float-features/src/big_float_operators.rs:90:9
   |
89 |     fn ln_big_float_ref(&self, a: &BigFloat) -> BigFloat {
   |                                                 -------- expected `multiversx_sc::types::BigFloat<<Self as multiversx_sc::contract_base::ContractBase>::Api>` because of return type
90 |         a.ln()
   |         ^^^^^^ expected `BigFloat<<... as ContractBase>::Api>`, found `Option<BigFloat<...>>`
   |
   = note: expected struct `multiversx_sc::types::BigFloat<_>`
                found enum `core::option::Option<multiversx_sc::types::BigFloat<_>>`
help: consider using `Option::expect` to unwrap the `core::option::Option<multiversx_sc::types::BigFloat<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` value, panicking if the value is an `Option::None`
   |
90 |         a.ln().expect("REASON")
   |               +++++++++++++++++


__END__