Skip to content

Commit dcb85aa

Browse files
sandreimAlexandruCihodaru
authored andcommitted
Update FamStruct primitive as interface changed
Signed-off-by: Andrei Sandu <[email protected]>
1 parent 184b38c commit dcb85aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/primitives.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,10 @@ where
369369
.map_err(|ref err| VersionizeError::Deserialize(format!("{:?}", err)))?;
370370
// Construct the object from the array items.
371371
// Header(T) fields will be initialized by Default trait impl.
372-
let mut object = FamStructWrapper::from_entries(&entries);
372+
let mut object = FamStructWrapper::from_entries(&entries)
373+
.map_err(|ref err| VersionizeError::Deserialize(format!("{:?}", err)))?;
373374
// Update Default T with the deserialized header.
374-
std::mem::replace(object.as_mut_fam_struct(), header);
375+
*object.as_mut_fam_struct() = header;
375376
Ok(object)
376377
}
377378

0 commit comments

Comments
 (0)