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

Rename FPCategory, FP* to FpCategory, Fp* to adhere to the naming convention #19758

Merged
merged 1 commit into from Dec 24, 2014

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Dec 11, 2014

This is a [breaking-change].

@lifthrasiir
Copy link
Contributor

I guess FpCategory is also a good target for enum namespacing.

brson added a commit to brson/rust that referenced this pull request Dec 12, 2014
brson added a commit to brson/rust that referenced this pull request Dec 13, 2014
@tbu-
Copy link
Contributor Author

tbu- commented Dec 18, 2014

@brson Rebased.

bors added a commit that referenced this pull request Dec 19, 2014
Rename `FPCategory`, `FP*` to `FpCategory`, `Fp*` to adhere to the naming convention

Reviewed-by: Gankro
@@ -18,7 +18,7 @@ pub use self::SignFormat::*;

use char::{mod, Char};
use kinds::Copy;
use num::{mod, Int, Float, FPNaN, FPInfinite, ToPrimitive};
use num::{mod, Int, Float, FpNaN, FpInfinite, ToPrimitive};
Copy link
Contributor

Choose a reason for hiding this comment

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

This got a problem! You should rename it to FpNa**n**.

@alexcrichton
Copy link
Member

Needs a rebase

/// "Not a Number", often obtained by dividing by zero
FPNaN,
FpNan,
Copy link
Member

Choose a reason for hiding this comment

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

Seems to me like the Fp part of these should be dropped entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sfackler So it should be FpCategory::Infinite? That sounds too long IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

If using it frequently, you can use FpCategory as Fp, or just use FpCategory::*.

@tbu-
Copy link
Contributor Author

tbu- commented Dec 22, 2014

@alexcrichton Rebased.

@alexcrichton
Copy link
Member

Ah yes I agree with @sfackler, could the Fp prefixes be dropped entirely now?

@tbu-
Copy link
Contributor Author

tbu- commented Dec 22, 2014

@alexcrichton Here you go!

Rename `FPCategory` to `FpCategory` and `Fp* to `*` in order to adhere to the
naming convention

This is a [breaking-change].

Existing code like this:
```
use std::num::{FPCategory, FPNaN};
```
should be adjusted to this:
```
use std::num::FpCategory as Fp
```

In the following code you can use the constants `Fp::Nan`, `Fp::Normal`, etc.
@tbu-
Copy link
Contributor Author

tbu- commented Dec 23, 2014

@alexcrichton Rebased after merge failure.

bors added a commit that referenced this pull request Dec 23, 2014
@bors bors merged commit 16f01cc into rust-lang:master Dec 24, 2014
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.

None yet

7 participants