| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Cargo expects `lib` to be table, not an array of tables (only single lib per project).
|
|
For a user following the path of reading Chapter 5: Syntax & Symantics
prior to Chapter 4: Learn Rust, this will be the first time they have
encountered executable tests inside documentation comments.
The test will fail because the `add_one` function is not defined in
the context of the doctest. This might not be the optimal place to
introduce and explain the `/// #` notation but I think it is important
that this snippet pass as a test when `rustdoc --test` is run against
it.
|
|
to address https://github.com/rust-lang/rust/issues/25488 .
|
|
|
|
The doc indicates that you can replace 'before' with 'after' showing the use of try!. The two examples should be equivalent, but they are not.
In the File::create we were inducing a panic before in case of error, not propagating. It is important for newbies (like myself) to understand that try! propagates failures, while unwrap can induce a panic.
The other alternative is to make the 'before' File::create also manually handle Err like the other calls. Either way it would be consistent.
|
|
As mentioned in #25893 the copy trait is not very well explained for beginners. There is no clear mention that all primitive types implement the copy trait and there are not a lot of examples.
With this change I try to make it more visible and understandable for new users.
I myself have struggled with this, see [my question on stackoverflow](http://stackoverflow.com/questions/30540419/why-are-booleans-copyable-even-though-the-documentation-doesnt-indicate-that). And I want to make it more transparent for others.
I filed issue #25893 but I thought that I could give it a shot myself to relieve some of the work from the devs :)
If it is not well written or there are some changes to be made before it can be merged, let me know.
Cheers,
Mathieu
|
|
|
|
Cargo expects `lib` to be table, not an array of tables (only single lib per project).
|
|
|
|
For a user following the path of reading Chapter 5: Syntax & Symantics
prior to Chapter 4: Learn Rust, this will be the first time they have
encountered executable tests inside documentation comments.
The test will fail because the `add_one` function is not defined in
the context of the doctest. This might not be the optimal place to
introduce and explain the `/// #` notation but I think it is important
that this snippet pass as a test when `rustdoc --test` is run against
it if it is going to be shown.
|
|
The sensible default used here for the version number in the
auto-generated Cargo.toml is 0.1.0, not 0.0.1 (at least as of cargo
0.2.0-nightly efb482d).
|
|
The sensible default used here for the version number in the
auto-generated Cargo.toml is 0.1.0, not 0.0.1 (at least as of cargo
0.2.0-nightly).
|
|
Added a sentence that tells the user that using main.rs and/or lib.rs is required for Cargo.
|
|
|
|
|
|
|
|
Added a sentence that tells the user that using main.rs and/or lib.rs is required for Cargo.
|
|
|
|
The statement is not completely exact, because it is valid to have
both 0 non-mutable references and 1 mutable reference. Instead, use
the same wording as in mutability.md.
|
|
Hi
I added a little section in the for loops about the `enumerate()` function.
I think it's useful for beginners to know this function and how you can use it.
I used the title loopcounter, but it's probably not the best word to describe it. So let me know if there is a better word :)
|
|
|
|
The statement is not completely exact, because it is valid to have
both 0 non-mutable references and 1 mutable reference. Instead, use
the same wording as in mutability.md.
|
|
to address https://github.com/rust-lang/rust/issues/25488 .
|
|
|
|
r=steveklabnik
|
|
trpl: Fix typo in Raw Pointers chapter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r? @steveklabnik
|
|
|
|
|
|
|
|
Fix the actual off by one
|
|
`(1..100).map(|x| x + 1)` is actually mapping [1,100) to [2,101)
|
|
Sometimes loop counters are useful and we should show new users how it is achieved in Rust.
|
|
|
|
|
|
Fixes #25554
|
|
The doc indicates that you can replace 'before' with 'after' showing the use of try!. The two examples should be equivalent, but they are not.
In the File::create we were inducing a panic before in case of error, not propagating. It is important for newbies (like myself) to understand that try! propagates failures, while unwrap can induce a panic.
The other alternative is to make the 'before' File::create also manually handle Err like the other calls. Either way it would be consistent.
|
|
As mentioned in #25893 the copy trait is not very well explained for beginners. There is no clear mention that all primitive types implement the copy trait and there are not a lot of examples.
With this change I try to make it more visible and understandable for new users.
I myself have struggled with this, see [my question on stackoverflow](http://stackoverflow.com/questions/30540419/why-are-booleans-copyable-even-though-the-documentation-doesnt-indicate-that). And I want to make it more transparent for others.
I filed issue #25893 but I thought that I could give it a shot myself to relieve some of the work from the devs :)
If it is not well written or there are some changes to be made before it can be merged, let me know.
Cheers,
Mathieu
|
|
r? @steveklabnik
|
|
Fixes #25417
|
|
"workd" corrected to "world"
|
|
There was no opening parenthesis for this closing parenthesis...
|
|
r=steveklabnik
r? @steveklabnik
|