sqlx
sqlx copied to clipboard
Rust decimal not implement std::error:Error
Hi guys!
I have an issue when try build my project with rust_decimal
error[E0277]: the trait bound `rust_decimal::Error: std::error::Error` is not satisfied
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.4.0-beta.1/src/postgres/types/decimal.rs:171:73
|
171 | PgValueFormat::Text => Ok(value.as_str()?.parse::<Decimal>()?),
| ^ the trait `std::error::Error` is not implemented for `rust_decimal::Error`
|
= note: required because of the requirements on the impl of `std::convert::From<rust_decimal::Error>` for `std::boxed::Box<dyn std::error::Error + std::marker::Send + std::marker::Sync>`
= note: required by `std::convert::From::from`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
error: could not compile `sqlx-core`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
I try to force the rust_decimal version to 1.7.0 but it doesn't work, keep using 1.8.0
rust_decimal 1.8.0
rust_decimal 1.7.0

I found the solution
Is needed add feature std on rust_decimal