File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ impl<'a> Run<'a> {
233
233
protobuf_path : & str ,
234
234
result : & mut HashMap < String , FileDescriptorPair > ,
235
235
) {
236
- if result. get ( protobuf_path) . is_some ( ) {
236
+ if result. contains_key ( protobuf_path) {
237
237
return ;
238
238
}
239
239
@@ -257,7 +257,7 @@ impl<'a> Run<'a> {
257
257
}
258
258
259
259
fn add_file ( & mut self , protobuf_path : & str , fs_path : & Path ) -> io:: Result < ( ) > {
260
- if self . parsed_files . get ( protobuf_path) . is_some ( ) {
260
+ if self . parsed_files . contains_key ( protobuf_path) {
261
261
return Ok ( ( ) ) ;
262
262
}
263
263
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ trait ToChar {
106
106
107
107
impl ToI32 for u64 {
108
108
fn to_i32 ( & self ) -> ParserResult < i32 > {
109
- if * self <= i32:: max_value ( ) as u64 {
109
+ if * self <= i32:: MAX as u64 {
110
110
Ok ( * self as i32 )
111
111
} else {
112
112
Err ( ParserError :: IntegerOverflow )
@@ -116,7 +116,7 @@ impl ToI32 for u64 {
116
116
117
117
impl ToI32 for i64 {
118
118
fn to_i32 ( & self ) -> ParserResult < i32 > {
119
- if * self <= i32:: max_value ( ) as i64 && * self >= i32:: min_value ( ) as i64 {
119
+ if * self <= i32:: MAX as i64 && * self >= i32:: MIN as i64 {
120
120
Ok ( * self as i32 )
121
121
} else {
122
122
Err ( ParserError :: IntegerOverflow )
@@ -126,7 +126,7 @@ impl ToI32 for i64 {
126
126
127
127
impl ToI64 for u64 {
128
128
fn to_i64 ( & self ) -> Result < i64 , ParserError > {
129
- if * self <= i64:: max_value ( ) as u64 {
129
+ if * self <= i64:: MAX as u64 {
130
130
Ok ( * self as i64 )
131
131
} else {
132
132
Err ( ParserError :: IntegerOverflow )
@@ -1378,7 +1378,7 @@ impl<'a> Parser<'a> {
1378
1378
let from = self . next_field_number ( ) ?;
1379
1379
let to = if self . next_ident_if_eq ( "to" ) ? {
1380
1380
if self . next_ident_if_eq ( "max" ) ? {
1381
- i32:: max_value ( )
1381
+ i32:: MAX
1382
1382
} else {
1383
1383
self . next_field_number ( ) ?
1384
1384
}
You can’t perform that action at this time.
0 commit comments