diff --git a/src/builtins/string.rs b/src/builtins/string.rs index 994ca4aff..de6262e07 100644 --- a/src/builtins/string.rs +++ b/src/builtins/string.rs @@ -262,9 +262,7 @@ fn width_without_escapes(ins: &wstr, start_pos: usize) -> usize { pos += 1; } } - // we subtracted less than we added - debug_assert!(width >= 0, "line has negative width"); - return width as usize; + usize::try_from(width).expect("line has negative width") } /// Empirically determined.