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
Dynamic Int generation + integer primitive fixes (#97)
* Dynamic Int generation
Previously the `Int` struct was statically defined. This causes issues
because some traits, wrappers, etc are only needed for certain runtime
configurations (e.g. preserve-encodings) or usages (e.g. if it's used as a key).
This also introduces more functionality like a wasm wrapper again and
conversion traits.
Fixes#55
* Fixes for different int precisions + Tests
Fixes#57
Also addresses issues with other primtive types e.g. i8, i64, u8, etc
and adds unit tests to cover all of them.
Fixes a few issues with wasm bindings for `Int`.
* Misc fixes
* Option<T> for non-primitive T compiles properly now (doesn't use a
ref)
* removed TODO that was actually already implemented
* fix for maps in keys (OrderedHashMap now derives comparisons when
needed)
* Full nint support
Now even with `preserve-encodings=false` we use the
`*negative_integer_sz()` functions in `cbor_event` as the non-`_sz` ones
have two issues: 1) they use `i64` as an interface and thus only cover
half of `nint`'s range and 2) there is a panic when serializing
`i64::MIN` so even for `i64` it is not complete.
See primetype/cbor_event#9
This commit also changes the `nint` type to be an unsigned `u64` to
cover the complete range and not allow in the rust code values from both
sides of the sign. This might be a little awkward it is represents
exactly the values possible with `nint`.
Negative constants are also added by this.
* link cbor_event upstream issue
Co-authored-by: Sebastien Guillemot <[email protected]>
0 commit comments