File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ impl DataType {
56
56
for literal in self . display_literals :: < Endian > ( bytes) {
57
57
strs. push ( format ! ( "{}: {}" , self , literal) )
58
58
}
59
- return strs;
59
+ strs
60
60
}
61
61
62
62
pub fn display_literals < Endian : ByteOrder > ( & self , bytes : & [ u8 ] ) -> Vec < String > {
@@ -129,13 +129,13 @@ impl DataType {
129
129
strs. push ( format ! ( "{:#?}" , bytes) ) ;
130
130
}
131
131
DataType :: String => {
132
- if let Some ( cstr) = CStr :: from_bytes_until_nul ( bytes) . ok ( ) {
132
+ if let Ok ( cstr) = CStr :: from_bytes_until_nul ( bytes) {
133
133
strs. push ( format ! ( "{:?}" , cstr) ) ;
134
134
}
135
135
}
136
136
}
137
137
138
- return strs;
138
+ strs
139
139
}
140
140
141
141
fn required_len ( & self ) -> Option < usize > {
@@ -200,9 +200,9 @@ pub trait ObjArch: Send + Sync {
200
200
. map ( |ty| {
201
201
self . display_data_labels ( ty, & reloc. target . bytes [ reloc. addend as usize ..] )
202
202
} )
203
- . unwrap_or_else ( Vec :: new ) ;
203
+ . unwrap_or_default ( ) ;
204
204
}
205
- return Vec :: new ( ) ;
205
+ Vec :: new ( )
206
206
}
207
207
208
208
fn display_ins_data_literals ( & self , ins : & ObjIns ) -> Vec < String > {
@@ -215,9 +215,9 @@ pub trait ObjArch: Send + Sync {
215
215
. map ( |ty| {
216
216
self . display_data_literals ( ty, & reloc. target . bytes [ reloc. addend as usize ..] )
217
217
} )
218
- . unwrap_or_else ( Vec :: new ) ;
218
+ . unwrap_or_default ( ) ;
219
219
}
220
- return Vec :: new ( ) ;
220
+ Vec :: new ( )
221
221
}
222
222
223
223
// Downcast methods
You can’t perform that action at this time.
0 commit comments