File tree Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -1019,27 +1019,26 @@ impl Literal {
1019
1019
1020
1020
#[ cfg( span_locations) ]
1021
1021
{
1022
- use crate :: convert:: usize_to_u32;
1023
1022
use core:: ops:: Bound ;
1024
1023
1025
1024
let lo = match range. start_bound ( ) {
1026
1025
Bound :: Included ( start) => {
1027
- let start = usize_to_u32 ( * start) ?;
1026
+ let start = u32 :: try_from ( * start) . ok ( ) ?;
1028
1027
self . span . lo . checked_add ( start) ?
1029
1028
}
1030
1029
Bound :: Excluded ( start) => {
1031
- let start = usize_to_u32 ( * start) ?;
1030
+ let start = u32 :: try_from ( * start) . ok ( ) ?;
1032
1031
self . span . lo . checked_add ( start) ?. checked_add ( 1 ) ?
1033
1032
}
1034
1033
Bound :: Unbounded => self . span . lo ,
1035
1034
} ;
1036
1035
let hi = match range. end_bound ( ) {
1037
1036
Bound :: Included ( end) => {
1038
- let end = usize_to_u32 ( * end) ?;
1037
+ let end = u32 :: try_from ( * end) . ok ( ) ?;
1039
1038
self . span . lo . checked_add ( end) ?. checked_add ( 1 ) ?
1040
1039
}
1041
1040
Bound :: Excluded ( end) => {
1042
- let end = usize_to_u32 ( * end) ?;
1041
+ let end = u32 :: try_from ( * end) . ok ( ) ?;
1043
1042
self . span . lo . checked_add ( end) ?
1044
1043
}
1045
1044
Bound :: Unbounded => self . span . hi ,
Original file line number Diff line number Diff line change @@ -141,8 +141,6 @@ use crate::fallback as imp;
141
141
#[ cfg( wrap_proc_macro) ]
142
142
mod imp;
143
143
144
- #[ cfg( span_locations) ]
145
- mod convert;
146
144
#[ cfg( span_locations) ]
147
145
mod location;
148
146
You can’t perform that action at this time.
0 commit comments