Skip to content

replace deprecated uint references with u32 in trpl/looping.md #20956

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

Merged
merged 1 commit into from
Jan 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/doc/trpl/looping.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The other kind of looping construct in Rust is the `while` loop. It looks like
this:

```{rust}
let mut x = 5u; // mut x: uint
let mut x = 5u32; // mut x: u32
Copy link
Contributor

Choose a reason for hiding this comment

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

Strictly speaking, you can put no suffix and get the same code (well, it would use i32), but I'm not sure if that effects the meaning steve was going for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If no suffix is preferred in this case, I'd be happy to make that change instead, and create a new PR. I was mostly interested in clearing compiler warnings due to the deprecated uint type.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can take this for now as a strict improvement, actually.

Copy link
Member

Choose a reason for hiding this comment

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

I generally want to have no type where we can.

let mut done = false; // mut done: bool

while !done {
Expand Down Expand Up @@ -91,7 +91,7 @@ can do with safety and code generation, so you should always prefer
Let's take a look at that `while` loop we had earlier:

```{rust}
let mut x = 5u;
let mut x = 5u32;
let mut done = false;

while !done {
Expand All @@ -108,7 +108,7 @@ modifying iteration: `break` and `continue`.
In this case, we can write the loop in a better way with `break`:

```{rust}
let mut x = 5u;
let mut x = 5u32;

loop {
x += x - 3;
Expand Down