Skip to content

Remove {uint,int,u64,i64,...}::from_str,from_str_radix #9209

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
wants to merge 1 commit into from
Closed

Remove {uint,int,u64,i64,...}::from_str,from_str_radix #9209

wants to merge 1 commit into from

Conversation

bluss
Copy link
Member

@bluss bluss commented Sep 15, 2013

Remove these in favor of the two traits themselves and the wrapper
function std::from_str::from_str.

Add the function std::num::from_str_radix in the corresponding role for
the FromStrRadix trait.

With from_str in the prelude, and from_str_radix in std::num, the feature is unfied under the type annotation of these functions instead of using the modules-named-as-types (std::uint and others):

What was before:

let n = std::uint::from_str("1");
let m = std::i32::from_str_radix("10", 16);

is now:

let n = from_str::<uint>("1");
let m = std::num::from_str_radix::<i32>("10", 16);

Remove these in favor of the two traits themselves and the wrapper
function std::from_str::from_str.

Add the function std::num::from_str_radix in the corresponding role for
the FromStrRadix trait.
bors added a commit that referenced this pull request Sep 15, 2013
Remove these in favor of the two traits themselves and the wrapper
function std::from_str::from_str.

Add the function std::num::from_str_radix in the corresponding role for
the FromStrRadix trait.

With `from_str` in the prelude, and `from_str_radix` in `std::num`, the feature is unfied under the type annotation of these functions instead of using the modules-named-as-types (std::uint and others):

What was before:

    let n = std::uint::from_str("1");
    let m = std::i32::from_str_radix("10", 16);

is now:

    let n = from_str::<uint>("1");
    let m = std::num::from_str_radix::<i32>("10", 16);
@bors bors closed this Sep 15, 2013
bors added a commit that referenced this pull request Sep 18, 2013
std: Remove {float,f64,f32}::from_str in favor of from_str in the prelude

Like issue #9209, remove float::{from_str, from_str_radix} in favor of
the two corresponding traits. The same for modules f64 and f32.

New usage is:

    from_str::<float>("1.2e34")
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