We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6dae31a commit decff38Copy full SHA for decff38
src/tests/rust_fmt_argument_max_padding.rs
@@ -233,10 +233,12 @@ fn test_format_specifiers_int_max_fail() {
233
let fmt_str = format!("'%{width}{spec}'");
234
// Use a very small buffer to force a write failure.
235
let mut buf = [0u8; 100];
236
- let result = TimeFormatter::new(&time, fmt_str.as_bytes()).fmt(&mut &mut buf[..]);
+ let err = TimeFormatter::new(&time, fmt_str.as_bytes())
237
+ .fmt(&mut &mut buf[..])
238
+ .unwrap_err();
239
assert!(
- matches!(result, Err(Error::WriteZero)),
- "Expected an error for specifier '{spec}' with width {width} but got success",
240
+ matches!(err, Error::WriteZero),
241
+ "Expected write failure for specifier '{spec}' with width {width} but got unexpected error: {err:?}",
242
);
243
}
244
0 commit comments