Promote debug-only assertion

This commit is contained in:
Johannes Altmanninger
2024-02-14 22:24:39 +01:00
parent a1ed63fd83
commit d3b700f98c

View File

@@ -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.