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

std::fmt module documentation error #22646

Closed
leonardinius opened this issue Feb 21, 2015 · 6 comments
Closed

std::fmt module documentation error #22646

leonardinius opened this issue Feb 21, 2015 · 6 comments

Comments

@leonardinius
Copy link

See http://doc.rust-lang.org/std/fmt/index.html

e.g. http://doc.rust-lang.org/src/collections/fmt.rs.html#365-369

'0' - This is used to indicate for integer formats that the padding should both be done with a 0 character as well as be sign-aware. A format like {:08d} would yield 00000001 for the integer 1, while the same format would yield -0000001 for the integer -1. Notice that the negative version has one fewer zero than the positive version.

It seems what instead of {:08d}, {:08} is required.

E.g. (http://is.gd/oL48zO)

fn main() {
    println!("{:08d}", 10i32); 
}

produces

<anon>:2:24: 2:29 error: unknown format trait `d`
<anon>:2     println!("{:08d}", 10i32); 
                                ^~~~~
@leonardinius
Copy link
Author

I tried to search already reported issue, no luck.
If it's something really worthy, I might try to come up with PR to fix it.

@leonardinius
Copy link
Author

So, does it qualify for a proper PR?

I'm new in Rust ecosystem and I thought it could be a good way to both contribute back and start small, e.g. understand how the whole process works ... ;)

Edit s/smart/small/

@steveklabnik
Copy link
Member

yes, absolutely! If you have the time, that'd be great.

@steveklabnik
Copy link
Member

You can check out https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md for full details, but basically, just make a pull request :)

@leonardinius
Copy link
Author

Great, will do it some time during this week.

leonardinius pushed a commit to leonardinius/rust that referenced this issue Mar 1, 2015
Removes deprecated `{:08d}` format from the module documentation.
`{:08}` should be used instead now.
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 2, 2015
…veklabnik

 Addresses rust-lang#22646

Removes deprecated `{:08d}` format from the module documentation.
`{:08}` should be used instead now.
@leonardinius
Copy link
Author

#22925 fixed the issue

http://doc.rust-lang.org/std/fmt/#sign/#/0 seems to be updated, closing this one.

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

No branches or pull requests

3 participants