Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parsing numbers more than i32 and u32 #87

Merged
merged 3 commits into from
Sep 17, 2023

Conversation

NAlexandrov
Copy link
Contributor

fix #85

@dmah42
Copy link

dmah42 commented Jan 3, 2023

is there anything i can do to help this PR along?

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies this slipped off my radar somehow, just some minor nits.

Could I also ask you to please sign the CLA and I can then get this in.

Edit: looking into CI failures (CI should run and work if you push another commit)

@@ -152,14 +152,20 @@ impl<'de> serde::de::Visitor<'de> for KindVisitor {
where
E: de::Error,
{
self.visit_i32(v.try_into().map_err(de::Error::custom)?)
if v > -(1 << 53) && v < 1 << 53 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if v > -(1 << 53) && v < 1 << 53 {
if v > -(1 << f64::MANTISSA_DIGITS) && v < 1 << f64::MANTISSA_DIGITS {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -187,14 +193,20 @@ impl<'de> serde::de::Visitor<'de> for KindVisitor {
where
E: de::Error,
{
self.visit_u32(v.try_into().map_err(de::Error::custom)?)
if v < 1 << 53 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if v < 1 << 53 {
if v < 1 << f64::MANTISSA_DIGITS {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@NAlexandrov
Copy link
Contributor Author

Could I also ask you to please sign the CLA and I can then get this in.

done

@tustvold tustvold merged commit fc231ac into influxdata:main Sep 17, 2023
2 checks passed
@tustvold
Copy link
Contributor

Sorry this took quite so long to get to... I've been a bit distracted with other projects 😅

Farhad-Shabani added a commit to informalsystems/pbjson that referenced this pull request Dec 20, 2023
* chore: fix CI builds (influxdata#104)

* chore: update prost to 0.12 (influxdata#111)

* chore: update prost to 0.12

* chore: fix lint

* chore: update descriptors

---------

Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>

* fix: parsing numbers more than i32 and u32 (influxdata#87)

* fix: parsing numbers more than i32 and u32

* fix: f64::MANTISSA_DIGITS instead of 53

---------

Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>

* fix: Resolve Envoy xDS proto issues (influxdata#103)

* fix: Escape Self since it is a reserved keyword

* fix: Allow duplicate numbers in enums when aliases are enabled

* fix: Avoid field name collisions with the map ident

* fix: follow cargo best practice in build.rs script (influxdata#90)

Using env! inside the build.rs script makes it difficult to build this
package with other build tools like bazel which sandbox execution, since
the source directory might be at different paths between when the
build.rs file is compiled, and when the resulting build script is
executed.

Cargo recommends that CARGO_MANIFEST_DIR is read at runtime instead:
https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

The above links also includes the promise that Cargo will set the cwd to
the crate's directory. This patch uses this to find the descriptors.bin
file.

Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>

* chore(deps): update itertools requirement from 0.10 to 0.11 (influxdata#98)

Updates the requirements on [itertools](https://github.com/rust-itertools/itertools) to permit the latest version.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](rust-itertools/itertools@v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>

* chore(deps): update base64 requirement from 0.13 to 0.21 (influxdata#89)

* chore(deps): update base64 requirement from 0.13 to 0.21

Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version.
- [Release notes](https://github.com/marshallpierce/rust-base64/releases)
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](marshallpierce/rust-base64@v0.13.0...v0.21.0)

---
updated-dependencies:
- dependency-name: base64
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: fix removed methods

* fix: indifferent padding

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>

* chore: prepare 0.6.0 (influxdata#112)

* fix: prost deprecations (influxdata#113)

* chore: patch release pjson-build 0.6.2 (influxdata#114)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Bob Aman <sporkmonger@users.noreply.github.com>
Co-authored-by: Jeffrey Smith II <jeffreyssmith2nd@gmail.com>
Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>
Co-authored-by: Nikolay Alexandrov <nick.alexandrov@gmail.com>
Co-authored-by: Thomas Gibson-Robinson <thomas.gibsonrobinson@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: out of range integral type conversion attempted
3 participants