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 {
392
392
if size > self . space {
393
393
self . print_stack . push ( PrintFrame :: Broken { indent : self . indent , breaks : token. breaks } ) ;
394
394
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
+ }
396
398
IndentStyle :: Visual => ( MARGIN - self . space ) as usize ,
397
399
} ;
398
400
} else {
Original file line number Diff line number Diff line change @@ -3,20 +3,17 @@ use std::borrow::Cow;
3
3
4
4
impl Printer {
5
5
/// "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 } )
11
8
}
12
9
13
10
/// Inconsistent breaking box
14
- pub fn ibox ( & mut self , indent : usize ) {
11
+ pub fn ibox ( & mut self , indent : isize ) {
15
12
self . rbox ( indent, Breaks :: Inconsistent )
16
13
}
17
14
18
15
/// Consistent breaking box
19
- pub fn cbox ( & mut self , indent : usize ) {
16
+ pub fn cbox ( & mut self , indent : isize ) {
20
17
self . rbox ( indent, Breaks :: Consistent )
21
18
}
22
19
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ pub struct State<'a> {
92
92
ann : & ' a ( dyn PpAnn + ' a ) ,
93
93
}
94
94
95
- crate const INDENT_UNIT : usize = 4 ;
95
+ crate const INDENT_UNIT : isize = 4 ;
96
96
97
97
/// Requires you to pass an input filename and reader so that
98
98
/// 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> {
139
139
}
140
140
}
141
141
142
- pub const INDENT_UNIT : usize = 4 ;
142
+ pub const INDENT_UNIT : isize = 4 ;
143
143
144
144
/// Requires you to pass an input filename and reader so that
145
145
/// it can scan the input text for comments to copy forward.
You can’t perform that action at this time.
0 commit comments