fix(prettier) Fix subtract with overflow (#1314)

This commit is contained in:
Cameron 2023-11-14 12:35:33 +00:00 committed by GitHub
parent 5f316626f6
commit 6a062a882f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,7 +89,7 @@ impl<'a> Printer<'a> {
}
Mode::Break => {
#[allow(clippy::cast_possible_wrap)]
let remaining_width = (self.options.print_width - self.pos) as isize;
let remaining_width = (self.options.print_width as isize) - (self.pos as isize);
if Self::fits(&docs, remaining_width) {
self.cmds.extend(