You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, notice that if reading fails, ? causes an early return. This leads to the struct_writer not getting closed; when the function returns, the struct_writer gets dropped and panics because it was not closed.
We need a way to "defuse" the struct_writer before returning an error.
The text was updated successfully, but these errors were encountered:
The
WriteAsIon
impl forLazyValue
and related types writes as it reads, which is fine for the happy path:ion-rust/src/lazy/encoder/write_as_ion.rs
Lines 521 to 530 in b245172
However, notice that if reading fails,
?
causes an early return. This leads to thestruct_writer
not getting closed; when the function returns, thestruct_writer
gets dropped and panics because it was not closed.We need a way to "defuse" the
struct_writer
before returning an error.The text was updated successfully, but these errors were encountered: