Skip to content

Commit 1cf1166

Browse files
Tweak integer to string conversion test a bit to be future-proof
1 parent bacd57a commit 1cf1166

File tree

1 file changed

+3
-3
lines changed
  • library/alloctests/tests

1 file changed

+3
-3
lines changed

library/alloctests/tests/num.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use std::str::FromStr;
33

44
fn assert_nb<Int: ToString + FromStr + Debug + Display + Eq>(value: Int) {
55
let s = value.to_string();
6-
let s2 = format!("{}", value);
6+
let s2 = format!("s: {}.", value);
77

8-
assert_eq!(s, s2);
8+
assert_eq!(format!("s: {s}."), s2);
99
let Ok(ret) = Int::from_str(&s) else {
1010
panic!("failed to convert into to string");
1111
};
@@ -49,7 +49,7 @@ int_to_s!(
4949
test_i16_to_string,
5050
i16,
5151
test_i32_to_string,
52-
i32,
52+
i32,
5353
test_i64_to_string,
5454
i64,
5555
test_i128_to_string,

0 commit comments

Comments
 (0)