Skip to content

Commit bfb15c6

Browse files
snoybergwebmaster128
authored andcommitted
Include type in Debug output
1 parent 401b6fb commit bfb15c6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/std/src/math/decimal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ impl fmt::Display for Decimal {
459459

460460
impl fmt::Debug for Decimal {
461461
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
462-
write!(f, "{}", self)
462+
write!(f, "Decimal({})", self)
463463
}
464464
}
465465

@@ -2028,7 +2028,7 @@ mod tests {
20282028

20292029
for s in test_cases {
20302030
let decimal = Decimal::from_str(s).unwrap();
2031-
assert_eq!(s, format!("{:?}", decimal));
2031+
assert_eq!(format!("Decimal({})", s), format!("{:?}", decimal));
20322032
}
20332033
}
20342034
}

packages/std/src/math/decimal256.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ impl fmt::Display for Decimal256 {
484484

485485
impl fmt::Debug for Decimal256 {
486486
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
487-
write!(f, "{}", self)
487+
write!(f, "Decimal256({})", self)
488488
}
489489
}
490490

@@ -2175,7 +2175,7 @@ mod tests {
21752175

21762176
for s in test_cases {
21772177
let decimal256 = Decimal256::from_str(s).unwrap();
2178-
assert_eq!(s, format!("{:?}", decimal256));
2178+
assert_eq!(format!("Decimal256({})", s), format!("{:?}", decimal256));
21792179
}
21802180
}
21812181
}

0 commit comments

Comments
 (0)