Skip to content

Commit

Permalink
Update FamStruct primitive as interface changed
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Sandu <[email protected]>
  • Loading branch information
sandreim authored and AlexandruCihodaru committed Mar 11, 2021
1 parent 184b38c commit dcb85aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,10 @@ where
.map_err(|ref err| VersionizeError::Deserialize(format!("{:?}", err)))?;
// Construct the object from the array items.
// Header(T) fields will be initialized by Default trait impl.
let mut object = FamStructWrapper::from_entries(&entries);
let mut object = FamStructWrapper::from_entries(&entries)
.map_err(|ref err| VersionizeError::Deserialize(format!("{:?}", err)))?;
// Update Default T with the deserialized header.
std::mem::replace(object.as_mut_fam_struct(), header);
*object.as_mut_fam_struct() = header;
Ok(object)
}

Expand Down

0 comments on commit dcb85aa

Please sign in to comment.