(mut model: pi::Model)
| 19 | |
| 20 | pub async fn create_and_update_pi(db: &DatabaseConnection) -> Result<(), DbErr> { |
| 21 | fn trunc_dec_scale(mut model: pi::Model) -> pi::Model { |
| 22 | model.decimal = model.decimal.trunc_with_scale(3); |
| 23 | model.big_decimal = model.big_decimal.with_scale(3); |
| 24 | model.decimal_opt = model.decimal_opt.map(|decimal| decimal.trunc_with_scale(3)); |
| 25 | model.big_decimal_opt = model |
| 26 | .big_decimal_opt |
| 27 | .map(|big_decimal| big_decimal.with_scale(3)); |
| 28 | model |
| 29 | } |
| 30 | |
| 31 | let pi = trunc_dec_scale(pi::Model { |
| 32 | id: 1, |
no outgoing calls
no test coverage detected