mirror of
https://github.com/rust-lang/book.git
synced 2026-12-01 01:51:22 -06:00
Merge pull request #326 from rust-lang/question-mark
Use stable in .travis.yml
This commit is contained in:
+2
-4
@@ -3,10 +3,8 @@ language: rust
|
|||||||
cache: cargo
|
cache: cargo
|
||||||
rust:
|
rust:
|
||||||
- nightly
|
- nightly
|
||||||
# - beta
|
- beta
|
||||||
# ^ to be changed once question_mark is in beta: 1.14
|
- stable
|
||||||
# - stable
|
|
||||||
# ^ to be changed once question_mark becomes stable: 1.14
|
|
||||||
before_script:
|
before_script:
|
||||||
- (cargo install mdbook || true)
|
- (cargo install mdbook || true)
|
||||||
script:
|
script:
|
||||||
|
|||||||
@@ -270,20 +270,7 @@ Listing 9-6: A function that returns errors to the calling code using `try!`
|
|||||||
|
|
||||||
Or as in Listing 9-7, which uses the question mark operator:
|
Or as in Listing 9-7, which uses the question mark operator:
|
||||||
|
|
||||||
<!-- I'll ghost everything except the question mark operator in the libreoffice
|
|
||||||
file. Also note the `#![feature(question_mark)]` line won't be needed once this
|
|
||||||
feature has made it into a stable version of Rust, which will happen well
|
|
||||||
before the book's publication.
|
|
||||||
|
|
||||||
In order to run the code examples that have the `#![feature(question_mark)]`
|
|
||||||
line, you'll need to install a nightly version of the Rust compiler. Again,
|
|
||||||
readers of the book won't need to do this since we expect the question mark
|
|
||||||
feature to stabilize before publication.
|
|
||||||
|
|
||||||
/Carol -->
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#![feature(question_mark)]
|
|
||||||
# fn main() {}
|
# fn main() {}
|
||||||
# use std::fs::File;
|
# use std::fs::File;
|
||||||
# use std::io;
|
# use std::io;
|
||||||
@@ -311,7 +298,6 @@ question mark operator permits chaining. We could further shorten this code
|
|||||||
by instead doing:
|
by instead doing:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#![feature(question_mark)]
|
|
||||||
# fn main() {}
|
# fn main() {}
|
||||||
# use std::fs::File;
|
# use std::fs::File;
|
||||||
# use std::io;
|
# use std::io;
|
||||||
|
|||||||
Reference in New Issue
Block a user