-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Replaces the free-standing functions in f32, &c. #7117
Conversation
Do you plan to do this for |
I plan on replacing the range functions with a |
@pcwalton I haven't considered range specifically, but I think it would make sense to go through std and find what free-standing functions would make sense to unify. |
@pcwalton Yeah, I did have that change done, but stashed it because I thought it might be incompatible with what @thestinger was proposing. |
It has apparently gone stale already, I'll rebase on |
@jensnockert needs a rebase |
@cmr I know, sorry, been quite busy since the tree reopened. |
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note: If you were using a function that corresponds to an operator, use the operator instead.
Apparently yesterday wasn't my day, and I forgot to add the changes to all the tests apparently, and in the end forgot the docs extra much. Please documentation, forgive me, I really do love you, I hope you forgive me. Next time we'll meet tutorial, I promise to bring cookies and tea. I really want to be best-friends-forever with you, <3. XOXO
@bors, the tutorial: I really hope you forgive me for failing you two. I don't know why I forgot the changes to the docs, I am really sorry. hugs |
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. This means that instead of having to know everywhere what the type is, like ~~~ f64::sin(x) ~~~ You can simply write code that uses the type-generic versions in num instead, this works for all types that implement the corresponding trait in num. ~~~ num::sin(x) ~~~ Note 1: If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note 2: If you were using a function that corresponds to an operator, use the operator instead. Note 3: This is just #7090 reopened against master.
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16,
u32, u64, float, int, and uint are replaced with generic functions in
num instead.
This means that instead of having to know everywhere what the type is, like
You can simply write code that uses the type-generic versions in num instead, this works for all types that implement the corresponding trait in num.
Note 1: If you were previously using any of those functions, just replace them
with the corresponding function with the same name in num.
Note 2: If you were using a function that corresponds to an operator, use the
operator instead.
Note 3: This is just #7090 reopened against master.