File tree 1 file changed +13
-15
lines changed
1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -220,21 +220,19 @@ impl MechanismInfo {
220
220
221
221
impl std:: fmt:: Display for MechanismInfo {
222
222
fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
223
- let flags = format ! ( "{0:#?}" , self . flags) ;
224
- let key_size_info = match self . min_key_size == 0 && self . max_key_size == 0 {
225
- true => String :: new ( ) ,
226
- false => {
227
- if self . max_key_size == 0 {
228
- format ! ( ", min_key_size={}" , self . min_key_size)
229
- } else {
230
- format ! (
231
- ", min_key_size={}, max_key_size={}" ,
232
- self . min_key_size, self . max_key_size
233
- )
234
- }
235
- }
236
- } ;
237
- write ! ( f, "{}{}" , flags, key_size_info)
223
+ write ! ( f, "{:#?}" , self . flags) ?;
224
+
225
+ if self . min_key_size == 0 && self . max_key_size == 0 {
226
+ return Ok ( ( ) ) ;
227
+ }
228
+
229
+ write ! ( f, ", min_key_size={}" , self . min_key_size) ?;
230
+
231
+ if self . max_key_size != 0 {
232
+ write ! ( f, ", max_key_size={}" , self . max_key_size) ?;
233
+ }
234
+
235
+ Ok ( ( ) )
238
236
}
239
237
}
240
238
You can’t perform that action at this time.
0 commit comments