Skip to content

int::from_str lacks radix option #1784

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

Closed
mcandre opened this issue Feb 8, 2012 · 6 comments
Closed

int::from_str lacks radix option #1784

mcandre opened this issue Feb 8, 2012 · 6 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@mcandre
Copy link

mcandre commented Feb 8, 2012

int::to_str has a radix option but not int::from_str.

@grahame
Copy link
Contributor

grahame commented Mar 13, 2012

so should int::from_str just take a radix option?
.. in which case, what's a good name for the fn that has a default of 10 as the radix?

currently:
int::str produces a str from an int with base 10
int::to_str produces a str from an int in base whatever
int::from_str produces an int from an str in base 10

@catamorphism
Copy link
Contributor

As no one seems to feel strongly, please feel free to submit a pull request that makes the conversion functions more internally consistent.

@brson
Copy link
Contributor

brson commented Jul 31, 2012

I think to_str and from_str should not take a radix so they can conform to standard traits (from_str requiring static methods). str and to_str definitely seem backward to me.

@brson
Copy link
Contributor

brson commented Jul 31, 2012

Not just backwards, but confusingly named. How about to_str and to_str_radix, and from_str and from_str_radix?

@z0w0
Copy link
Contributor

z0w0 commented Feb 16, 2013

This looks like it can be closed now.

@catamorphism
Copy link
Contributor

Yes, this is fixed as of 0dc843b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

5 participants