Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upTRPL: guessing game #25080
Conversation
rust-highfive
assigned
pcwalton
May 3, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rust-highfive
May 3, 2015
Collaborator
r? @pcwalton
(rust_highfive has picked a reviewer for you, use r? to override)
|
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
steveklabnik
assigned
alexcrichton
and unassigned
pcwalton
May 3, 2015
killercup
reviewed
May 3, 2015
| let input = io::stdin().read_line(&mut guess) | ||
| .ok() | ||
| .expect("Failed to read line"); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
killercup
May 3, 2015
Member
I'd probably put the read_line call on a new line as well. Or put .ok().expect(... on the same line. (Same below, where you explain stdin, then read_line, then ok().explain.)
killercup
May 3, 2015
Member
I'd probably put the read_line call on a new line as well. Or put .ok().expect(... on the same line. (Same below, where you explain stdin, then read_line, then ok().explain.)
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
steveklabnik
May 3, 2015
Member
yeah, it's debateable. I think i'll leave it like this for now, though. This is, of course, ridiculously subjective.
steveklabnik
May 3, 2015
Member
yeah, it's debateable. I think i'll leave it like this for now, though. This is, of course, ridiculously subjective.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
killercup
May 3, 2015
Member
Good read. I've added a few comments for questions and typos. Feel free to ignore my stylistic suggestions :)
|
Good read. I've added a few comments for questions and typos. Feel free to ignore my stylistic suggestions :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Thanks @killercup and @parir ! nits addressed |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexcrichton
May 4, 2015
Member
Amazing @steveklabnik!
Only a few stylistic nits from me, but otherwise r=me
|
Amazing @steveklabnik! Only a few stylistic nits from me, but otherwise r=me |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
steveklabnik
May 4, 2015
Member
Woot! About to board a plane, but I'll get on it tomorrow. I gotta get used to linking to more docs :)
|
Woot! About to board a plane, but I'll get on it tomorrow. I gotta get used to linking to more docs :) |
huonw
reviewed
May 4, 2015
| rather than do all the work of figuring out versions again. This lets you | ||
| have a repeatable build automatically. | ||
| What about when we _do_ want to use `v0.4.0`? Cargo has another command, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
huonw
May 4, 2015
Member
NB. if the code above is changed to rand = "0.3" this section will need updating.
huonw
May 4, 2015
Member
NB. if the code above is changed to rand = "0.3" this section will need updating.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexcrichton
May 5, 2015
Member
The specification "0.3" to cargo indicates "0.3 compatible" and because 0.4 is not compatible with 0.3 it won't automatically pick it up (e.g. I believe @huonw is correct here)
alexcrichton
May 5, 2015
Member
The specification "0.3" to cargo indicates "0.3 compatible" and because 0.4 is not compatible with 0.3 it won't automatically pick it up (e.g. I believe @huonw is correct here)
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
steveklabnik
May 5, 2015
Member
"0.3.0" is shorthand for "^0.3.0" still, right? That should pick up 0.4.0, to be compatible with ^ requirements. It won't pick up a 1.0.0.
steveklabnik
May 5, 2015
Member
"0.3.0" is shorthand for "^0.3.0" still, right? That should pick up 0.4.0, to be compatible with ^ requirements. It won't pick up a 1.0.0.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexcrichton
May 5, 2015
Member
Yes, but 0.3.0 is not semver compatible with 0.4.0, so it won't pick it up
alexcrichton
May 5, 2015
Member
Yes, but 0.3.0 is not semver compatible with 0.4.0, so it won't pick it up
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
huonw
May 5, 2015
Member
Cargo takes 0.x to be the major releases for 0. versions, otherwise there wouldn't be a way to make incompatible releases other than going straight to 1.0. (docs)
In fact, strictly speaking even this is different to what semver really is:
Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
I.e. 0.3.1 is "meant" to be not compatible with 0.3.2, although I prefer our scheme.
huonw
May 5, 2015
Member
Cargo takes 0.x to be the major releases for 0. versions, otherwise there wouldn't be a way to make incompatible releases other than going straight to 1.0. (docs)
In fact, strictly speaking even this is different to what semver really is:
Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
I.e. 0.3.1 is "meant" to be not compatible with 0.3.2, although I prefer our scheme.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
steveklabnik
May 6, 2015
Member
Gotcha. Ouch :/ well, i'll write a patch for this later today, since this PR was merged. Thanks you two!
steveklabnik
May 6, 2015
Member
Gotcha. Ouch :/ well, i'll write a patch for this later today, since this PR was merged. Thanks you two!
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
huonw
reviewed
May 4, 2015
| takes a reference to the thing you want to compare it to. It returns the | ||
| `Ordering` type we `use`d earlier. We use a [`match`][match] statement to | ||
| determine exactly what kind of `Ordering` it is. `Ordering` is an | ||
| [`enum`][enum], short for ‘enumeration’, which looks like this: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
huonw
May 4, 2015
Member
Hm, this sentence is a bit confusing, since Ordering doesn't look like the enum below.
huonw
May 4, 2015
Member
Hm, this sentence is a bit confusing, since Ordering doesn't look like the enum below.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@bors: r=alexcrichton rollup |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
|
added a commit
to steveklabnik/rust
that referenced
this pull request
May 5, 2015
added a commit
that referenced
this pull request
May 5, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@bors: r=alexcrichton rollup |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
|
steveklabnik commentedMay 3, 2015
This also made me realize that I wasn't using the correct term,
'associated functions', rather than 'static methods'. So I corrected
that in the method syntax chapter.