amazon-ion / ion-rust

Rust implementation of Amazon Ion
Apache License 2.0
147 stars 35 forks source link

Make `ion_type()` correctly reflect typed nulls #828

Open zslayton opened 1 month ago

zslayton commented 1 month ago
          Could you put this functionality in a `self.read_null()` method instead of having it happen in `ion_type()`?

There are three other raw value types besides LazyRawBinaryValue_1_1:

Each of them has an ion_type() method and I'm pretty sure at least some of them return IonType::Null if the value is a null value, even if it's a typed null. The behavior you've implemented is probably more correct, but if we make this change here we'd need to make it in the other three places too.

_Originally posted by @zslayton in https://github.com/amazon-ion/ion-rust/pull/826#discussion_r1742481341_