File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,9 @@ impl Printer {
392392 if size > self . space {
393393 self . print_stack . push ( PrintFrame :: Broken { indent : self . indent , breaks : token. breaks } ) ;
394394 self . indent = match token. indent {
395- IndentStyle :: Block { offset } => ( self . indent as isize + offset) as usize ,
395+ IndentStyle :: Block { offset } => {
396+ usize:: try_from ( self . indent as isize + offset) . unwrap ( )
397+ }
396398 IndentStyle :: Visual => ( MARGIN - self . space ) as usize ,
397399 } ;
398400 } else {
Original file line number Diff line number Diff line change @@ -3,20 +3,17 @@ use std::borrow::Cow;
33
44impl Printer {
55 /// "raw box"
6- pub fn rbox ( & mut self , indent : usize , breaks : Breaks ) {
7- self . scan_begin ( BeginToken {
8- indent : IndentStyle :: Block { offset : indent as isize } ,
9- breaks,
10- } )
6+ pub fn rbox ( & mut self , indent : isize , breaks : Breaks ) {
7+ self . scan_begin ( BeginToken { indent : IndentStyle :: Block { offset : indent } , breaks } )
118 }
129
1310 /// Inconsistent breaking box
14- pub fn ibox ( & mut self , indent : usize ) {
11+ pub fn ibox ( & mut self , indent : isize ) {
1512 self . rbox ( indent, Breaks :: Inconsistent )
1613 }
1714
1815 /// Consistent breaking box
19- pub fn cbox ( & mut self , indent : usize ) {
16+ pub fn cbox ( & mut self , indent : isize ) {
2017 self . rbox ( indent, Breaks :: Consistent )
2118 }
2219
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ pub struct State<'a> {
9292 ann : & ' a ( dyn PpAnn + ' a ) ,
9393}
9494
95- crate const INDENT_UNIT : usize = 4 ;
95+ crate const INDENT_UNIT : isize = 4 ;
9696
9797/// Requires you to pass an input filename and reader so that
9898/// it can scan the input text for comments to copy forward.
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ impl<'a> PrintState<'a> for State<'a> {
139139 }
140140}
141141
142- pub const INDENT_UNIT : usize = 4 ;
142+ pub const INDENT_UNIT : isize = 4 ;
143143
144144/// Requires you to pass an input filename and reader so that
145145/// it can scan the input text for comments to copy forward.
You can’t perform that action at this time.
0 commit comments