@@ -232,10 +232,10 @@ impl<'a> TypedStreamDeserializer<'a> {
232232
233233 // The class we just appended (*idx*) is the **parent** of the
234234 // class we appended in the previous iteration (*prev_new*)
235- if let Some ( child_idx) = prev_new {
236- if let Archived :: Class ( ref mut child_cls) = self . object_table [ child_idx] {
237- child_cls . parent_index = Some ( idx ) ;
238- }
235+ if let Some ( child_idx) = prev_new
236+ && let Archived :: Class ( ref mut child_cls) = self . object_table [ child_idx]
237+ {
238+ child_cls . parent_index = Some ( idx ) ;
239239 }
240240
241241 // remember the first class we ever pushed
@@ -264,10 +264,10 @@ impl<'a> TypedStreamDeserializer<'a> {
264264
265265 // Patch the outer-most newly created class so that it points to the
266266 // already-existing parent (or to `None` if EMPTY terminated the list).
267- if let Some ( outer_idx) = prev_new {
268- if let Archived :: Class ( ref mut outer_cls) = self . object_table [ outer_idx] {
269- outer_cls . parent_index = final_parent ;
270- }
267+ if let Some ( outer_idx) = prev_new
268+ && let Archived :: Class ( ref mut outer_cls) = self . object_table [ outer_idx]
269+ {
270+ outer_cls . parent_index = final_parent ;
271271 }
272272
273273 // Return the index of the bottom-most child we created first.
@@ -294,15 +294,14 @@ impl<'a> TypedStreamDeserializer<'a> {
294294 // Read the next type, which should be an object
295295 if let Some ( next_index) = self . read_type ( false ) ? {
296296 // Recursively read the types for this object
297- if let Some ( data) = self . read_types ( next_index) ? {
298- if let Some ( Archived :: Object {
297+ if let Some ( data) = self . read_types ( next_index) ?
298+ && let Some ( Archived :: Object {
299299 class : _,
300300 data : data_vec,
301301 } ) = self . object_table . get_mut ( placeholder_index)
302- {
303- // Add the data to the object
304- data_vec. push ( data) ;
305- }
302+ {
303+ // Add the data to the object
304+ data_vec. push ( data) ;
306305 }
307306 }
308307 }
0 commit comments