Skip to content

Commit

Permalink
Merge pull request rust-lang#1992 from sebras/suggestions
Browse files Browse the repository at this point in the history
Clarifications and consistent use of quotation marks
  • Loading branch information
steveklabnik authored Oct 15, 2019
2 parents 9bb8b16 + 6598d3a commit 22397a0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/ch00-00-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ chapters. In concept chapters, you’ll learn about an aspect of Rust. In projec
chapters, we’ll build small programs together, applying what you’ve learned so
far. Chapters 2, 12, and 20 are project chapters; the rest are concept chapters.

Chapter 1 explains how to install Rust, how to write a Hello, world! program,
Chapter 1 explains how to install Rust, how to write a Hello, world! program,
and how to use Cargo, Rust’s package manager and build tool. Chapter 2 is a
hands-on introduction to the Rust language. Here we cover concepts at a high
level, and later chapters will provide additional detail. If you want to get
Expand Down
6 changes: 3 additions & 3 deletions src/ch01-01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ resources include [the Users forum][users] and [Stack Overflow][stackoverflow].

### Local Documentation

The installer also includes a copy of the documentation locally, so you can
read it offline. Run `rustup doc` to open the local documentation in your
browser.
The installation of Rust also includes a copy of the documentation locally, so
you can read it offline. Run `rustup doc` to open the local documentation in
your browser.

Any time a type or function is provided by the standard library and you’re not
sure what it does or how to use it, use the application programming interface
Expand Down
6 changes: 3 additions & 3 deletions src/ch01-02-hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ we suggest making a *projects* directory in your home directory and keeping all
your projects there.

Open a terminal and enter the following commands to make a *projects* directory
and a directory for the Hello, world! project within the *projects* directory.
and a directory for the Hello, world! project within the *projects* directory.

For Linux, macOS, and PowerShell on Windows, enter this:

Expand Down Expand Up @@ -86,7 +86,7 @@ program. That makes you a Rust programmer—welcome!

### Anatomy of a Rust Program

Let’s review in detail what just happened in your Hello, world! program.
Let’s review in detail what just happened in your Hello, world! program.
Here’s the first piece of the puzzle:

```rust
Expand Down Expand Up @@ -178,7 +178,7 @@ From here, you run the *main* or *main.exe* file, like this:
$ ./main # or .\main.exe on Windows
```

If *main.rs* was your Hello, world! program, this line would print `Hello,
If *main.rs* was your Hello, world! program, this line would print `Hello,
world!` to your terminal.

If you’re more familiar with a dynamic language, such as Ruby, Python, or
Expand Down
24 changes: 12 additions & 12 deletions src/ch01-03-hello-cargo.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ such as building your code, downloading the libraries your code depends on, and
building those libraries. (We call libraries your code needs *dependencies*.)

The simplest Rust programs, like the one we’ve written so far, don’t have any
dependencies. So if we had built the Hello, world! project with Cargo, it would
only use the part of Cargo that handles building your code. As you write more
complex Rust programs, you’ll add dependencies, and if you start a project
dependencies. So if we had built the Hello, world! project with Cargo, it
would only use the part of Cargo that handles building your code. As you write
more complex Rust programs, you’ll add dependencies, and if you start a project
using Cargo, adding dependencies will be much easier to do.

Because the vast majority of Rust projects use Cargo, the rest of this book
Expand All @@ -29,7 +29,7 @@ determine how to install Cargo separately.
### Creating a Project with Cargo

Let’s create a new project using Cargo and look at how it differs from our
original Hello, world! project. Navigate back to your *projects* directory (or
original Hello, world! project. Navigate back to your *projects* directory (or
wherever you decided to store your code). Then, on any operating system, run
the following:

Expand Down Expand Up @@ -99,25 +99,25 @@ fn main() {
}
```

Cargo has generated a Hello, world! program for you, just like the one we wrote
in Listing 1-1! So far, the differences between our previous project and the
project Cargo generates are that Cargo placed the code in the *src* directory,
and we have a *Cargo.toml* configuration file in the top directory.
Cargo has generated a Hello, world! program for you, just like the one we
wrote in Listing 1-1! So far, the differences between our previous project and
the project Cargo generates are that Cargo placed the code in the *src*
directory, and we have a *Cargo.toml* configuration file in the top directory.

Cargo expects your source files to live inside the *src* directory. The
top-level project directory is just for README files, license information,
configuration files, and anything else not related to your code. Using Cargo
helps you organize your projects. There’s a place for everything, and
everything is in its place.

If you started a project that doesn’t use Cargo, as we did with the Hello,
world! project, you can convert it to a project that does use Cargo. Move the
If you started a project that doesn’t use Cargo, as we did with the Hello,
world! project, you can convert it to a project that does use Cargo. Move the
project code into the *src* directory and create an appropriate *Cargo.toml*
file.

### Building and Running a Cargo Project

Now let’s look at what’s different when we build and run the Hello, world!
Now let’s look at what’s different when we build and run the Hello, world!
program with Cargo! From your *hello_cargo* directory, build your project by
entering the following command:

Expand Down Expand Up @@ -237,7 +237,7 @@ you’ve learned how to:
* Install the latest stable version of Rust using `rustup`
* Update to a newer Rust version
* Open locally installed documentation
* Write and run a Hello, world! program using `rustc` directly
* Write and run a Hello, world! program using `rustc` directly
* Create and run a new project using the conventions of Cargo

This is a great time to build a more substantial program to get used to reading
Expand Down
2 changes: 1 addition & 1 deletion src/ch02-00-guessing-game-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ io::stdin().read_line(&mut guess)
.expect("Failed to read line");
```

If we hadn’t listed the `use std::io` line at the beginning of the program, we
If we hadn’t put the `use std::io` line at the beginning of the program, we
could have written this function call as `std::io::stdin`. The `stdin` function
returns an instance of [`std::io::Stdin`][iostdin]<!-- ignore -->, which is a
type that represents a handle to the standard input for your terminal.
Expand Down
14 changes: 7 additions & 7 deletions src/ch03-02-data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ primitive compound types: tuples and arrays.

#### The Tuple Type

A tuple is a general way of grouping together some number of other values
with a variety of types into one compound type. Tuples have a fixed length:
once declared, they cannot grow or shrink in size.
A tuple is a general way of grouping together a number of values with a variety
of types into one compound type. Tuples have a fixed length: once declared,
they cannot grow or shrink in size.

We create a tuple by writing a comma-separated list of values inside
parentheses. Each position in the tuple has a type, and the types of the
Expand Down Expand Up @@ -286,8 +286,8 @@ fn main() {
```

This program creates a tuple, `x`, and then makes new variables for each
element by using their index. As with most programming languages, the first
index in a tuple is 0.
element by using their respective indices. As with most programming languages,
the first index in a tuple is 0.

#### The Array Type

Expand Down Expand Up @@ -318,7 +318,7 @@ vector. Chapter 8 discusses vectors in more detail.
An example of when you might want to use an array rather than a vector is in a
program that needs to know the names of the months of the year. It’s very
unlikely that such a program will need to add or remove months, so you can use
an array because you know it will always contain 12 items:
an array because you know it will always contain 12 elements:

```rust
let months = ["January", "February", "March", "April", "May", "June", "July",
Expand All @@ -334,7 +334,7 @@ let a: [i32; 5] = [1, 2, 3, 4, 5];
```

Here, `i32` is the type of each element. After the semicolon, the number `5`
indicates the element contains five items.
indicates the array contains five elements.

Writing an array’s type this way looks similar to an alternative syntax for
initializing an array: if you want to create an array that contains the same
Expand Down

0 comments on commit 22397a0

Please sign in to comment.