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

INF and NAN support everywhere #62

Merged
merged 2 commits into from
Jun 5, 2019
Merged

Conversation

Kampfkarren
Copy link
Member

Closes #39
I believe I got everything.

Copy link
Contributor

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

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

Good change! Minor feedback.

#[inline]
pub fn write_characters_f32(&mut self, value: f32) -> Result<(), NewEncodeError> {
self.write_characters_f64(value as f64)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm kind of nervous about casting NaN between f32 and f64. Can we duplicate the logic using the associated consts for f32?

Copy link
Member Author

Choose a reason for hiding this comment

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

self.write_characters("NAN")
} else {
self.write_characters(value)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be cleaner as a match statement. For the NaN case, we might be able to use a match guard like x if x.is_nan() => { ... }

Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't know that was a feature 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

warning: floating-point types cannot be used in patterns
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>

@@ -7,25 +7,125 @@
<string name="Name">Folder</string>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="NumberValue" referent="RBX3B3D9D3DB43D4E6793B190B081E0A886">
<Item class="Folder" referent="RBX84B85A2C500048E79846CD63A6127BA3">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid introducing a grouping for just the NumberValue instances and keep everything flat?

@LPGhatguy
Copy link
Contributor

Travis CI build failure is my fault, I'll get it fixed in master.

@Kampfkarren
Copy link
Member Author

@LPGhatguy Flattened the rbxmx file and responded to your other comments.

@LPGhatguy
Copy link
Contributor

Build failure doesn't look like your fault, I'll fix it post-merge.

@LPGhatguy LPGhatguy merged commit d09f5c9 into rojo-rbx:master Jun 5, 2019
@Kampfkarren Kampfkarren deleted the nanfix branch June 5, 2019 20:26
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.

2 participants