Skip to content

Commit f116ab5

Browse files
Dangthrimblesteveklabnik
authored andcommitted
2nd to 3rd person
Replacing all references to the 2nd person with references to the 3rd person (excluding `authors = [ "Your name <[email protected]>" ]` and `file:///home/yourname/projects/hello_world` in `hello-cargo.md`)
1 parent c146090 commit f116ab5

File tree

5 files changed

+143
-142
lines changed

5 files changed

+143
-142
lines changed

src/doc/trpl/README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% The Rust Programming Language
22

3-
Welcome! This book will teach you about the [Rust Programming Language][rust].
3+
Welcome! This book will teach us about the [Rust Programming Language][rust].
44
Rust is a systems programming language focused on three goals: safety, speed,
55
and concurrency. It maintains these goals without having a garbage collector,
66
making it a useful language for a number of use cases other languages aren’t
@@ -9,16 +9,15 @@ requirements, and writing low-level code, like device drivers and operating
99
systems. It improves on current languages targeting this space by having a
1010
number of compile-time safety checks that produce no runtime overhead, while
1111
eliminating all data races. Rust also aims to achieve ‘zero-cost abstractions’
12-
even though some of these abstractions feel like those of a high-level
13-
language. Even then, Rust still allows precise control like a low-level
14-
language would.
12+
even though some of these abstractions feel like those of a high-level language.
13+
Even then, Rust still allows precise control like a low-level language would.
1514

1615
[rust]: https://www.rust-lang.org
1716

1817
“The Rust Programming Language” is split into eight sections. This introduction
1918
is the first. After this:
2019

21-
* [Getting started][gs] - Set up your computer for Rust development.
20+
* [Getting started][gs] - Set up our computer for Rust development.
2221
* [Learn Rust][lr] - Learn Rust programming through small projects.
2322
* [Effective Rust][er] - Higher-level concepts for writing excellent Rust code.
2423
* [Syntax and Semantics][ss] - Each bit of Rust, broken down into small chunks.
@@ -34,11 +33,11 @@ is the first. After this:
3433
[gl]: glossary.html
3534
[bi]: bibliography.html
3635

37-
After reading this introduction, you’ll want to dive into either ‘Learn Rust’
38-
or ‘Syntax and Semantics’, depending on your preference: ‘Learn Rust’ if you
39-
want to dive in with a project, or ‘Syntax and Semantics’ if you prefer to
40-
start small, and learn a single concept thoroughly before moving onto the next.
41-
Copious cross-linking connects these parts together.
36+
After reading this introduction, we’ll want to dive into either ‘Learn Rust’ or
37+
‘Syntax and Semantics’, depending on our preference: ‘Learn Rust’ if we want to
38+
dive in with a project, or ‘Syntax and Semantics’ if we prefer to start small,
39+
and learn a single concept thoroughly before moving onto the next. Copious
40+
cross-linking connects these parts together.
4241

4342
### Contributing
4443

@@ -47,7 +46,7 @@ The source files from which this book is generated can be found on Github:
4746

4847
## A brief introduction to Rust
4948

50-
Is Rust a language you might be interested in? Let’s examine a few small code
49+
Is Rust a language we might be interested in? Let’s examine a few small code
5150
samples to show off a few of its strengths.
5251

5352
The main concept that makes Rust unique is called ‘ownership’. Consider this
@@ -76,11 +75,11 @@ type inference to balance out the power of static typing with the verbosity of
7675
annotating types.
7776

7877
Rust prefers stack allocation to heap allocation: `x` is placed directly on the
79-
stack. However, the `Vec<T>` type allocates space for the elements of the
80-
vector on the heap. If you’re not familiar with this distinction, you can
81-
ignore it for now, or check out [‘The Stack and the Heap’][heap]. As a systems
82-
programming language, Rust gives you the ability to control how your memory is
83-
allocated, but when we’re getting started, it’s less of a big deal.
78+
stack. However, the `Vec<T>` type allocates space for the elements of the vector
79+
on the heap. If we’re not familiar with this distinction, we can ignore it for
80+
now, or check out [‘The Stack and the Heap’][heap]. As a systems programming
81+
language, Rust gives us the ability to control how our memory is allocated, but
82+
when we’re getting started, it’s less of a big deal.
8483

8584
[var]: variable-bindings.html
8685
[macro]: macros.html
@@ -90,10 +89,10 @@ Earlier, we mentioned that ‘ownership’ is the key new concept in Rust. In Ru
9089
parlance, `x` is said to ‘own’ the vector. This means that when `x` goes out of
9190
scope, the vector’s memory will be de-allocated. This is done deterministically
9291
by the Rust compiler, rather than through a mechanism such as a garbage
93-
collector. In other words, in Rust, you don’t call functions like `malloc` and
94-
`free` yourself: the compiler statically determines when you need to allocate
95-
or deallocate memory, and inserts those calls itself. To err is to be human,
96-
but compilers never forget.
92+
collector. In other words, in Rust, we don’t call functions like `malloc` and
93+
`free` ourselves: the compiler statically determines when we need to allocate or
94+
deallocate memory, and inserts those calls itself. To err is to be human, but
95+
compilers never forget.
9796

9897
Let’s add another line to our example:
9998

src/doc/trpl/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Getting Started
22

3-
This first section of the book will get you going with Rust and its tooling.
3+
This first section of the book will get us going with Rust and its tooling.
44
First, we’ll install Rust. Then, the classic ‘Hello World’ program. Finally,
55
we’ll talk about Cargo, Rust’s build system and package manager.

src/doc/trpl/hello-cargo.md

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ so it is assumed that Rust projects will use Cargo from the beginning.
77

88
[cratesio]: http://doc.crates.io
99

10-
Cargo manages three things: building your code, downloading the dependencies
11-
your code needs, and building those dependencies. At first, your program doesn’t
12-
have any dependencies, so we’ll only be using the first part of its
13-
functionality. Eventually, we’ll add more. Since we started off by using Cargo,
14-
it'll be easy to add later.
10+
Cargo manages three things: building our code, downloading the dependencies our
11+
code needs, and building those dependencies. At first, our program doesn’t have
12+
any dependencies, so we’ll only be using the first part of its functionality.
13+
Eventually, we’ll add more. Since we started off by using Cargo, it'll be easy
14+
to add later.
1515

1616
If we installed Rust via the official installers we will also have Cargo. If we
1717
installed Rust some other way, we may want to [check the Cargo
@@ -41,18 +41,18 @@ specified with a [`[lib]` or `[[bin]]`][crates-custom] key in the TOML file.
4141

4242
[crates-custom]: http://doc.crates.io/manifest.html#configuring-a-target
4343

44-
Cargo expects your source files to live inside a `src` directory. That leaves
45-
the top level for other things, like READMEs, license information, and anything
46-
not related to your code. Cargo helps us keep our projects nice and tidy. A
47-
place for everything, and everything in its place.
44+
Cargo expects our source files to live inside a `src` directory. That leaves the
45+
top level for other things, like READMEs, license information, and anything not
46+
related to our code. Cargo helps us keep our projects nice and tidy. A place for
47+
everything, and everything in its place.
4848

4949
Next, our configuration file:
5050

5151
```bash
5252
$ editor Cargo.toml
5353
```
5454

55-
Make sure to get this name right: you need the capital `C`!
55+
Make sure to get this name right: we need the capital `C`!
5656

5757
Put this inside:
5858

@@ -109,25 +109,25 @@ about the future: when our project gets more complex, we need to do more
109109
things to get all of the parts to properly compile. With Cargo, as our project
110110
grows, we can just run `cargo build`, and it’ll work the right way.
111111

112-
When your project is finally ready for release, you can use
113-
`cargo build --release` to compile your project with optimizations.
112+
When our project is finally ready for release, we can use `cargo build
113+
--release` to compile our project with optimizations.
114114

115-
You'll also notice that Cargo has created a new file: `Cargo.lock`.
115+
We'll also notice that Cargo has created a new file: `Cargo.lock`.
116116

117117
```toml
118118
[root]
119119
name = "hello_world"
120120
version = "0.0.1"
121121
```
122122

123-
The `Cargo.lock` file is used by Cargo to keep track of dependencies in your application.
124-
Right now, we don’t have any, so it’s a bit sparse. You won't ever need
125-
to touch this file yourself, just let Cargo handle it.
123+
The `Cargo.lock` file is used by Cargo to keep track of dependencies in our
124+
application. Right now, we don’t have any, so it’s a bit sparse. We won't ever
125+
need to touch this file ourselves, just let Cargo handle it.
126126

127127
That’s it! We’ve successfully built `hello_world` with Cargo. Even though our
128-
program is simple, it’s using much of the real tooling that you’ll use for the
129-
rest of your Rust career. You can expect to do this to get started with
130-
virtually all Rust projects:
128+
program is simple, it’s using much of the real tooling that we’ll use for the
129+
rest of our Rust career. We can expect to do this to get started with virtually
130+
all Rust projects:
131131

132132
```bash
133133
$ git clone someurl.com/foo
@@ -137,17 +137,19 @@ $ cargo build
137137

138138
## A New Project
139139

140-
You don’t have to go through this whole process every time you want to start a
141-
new project! Cargo has the ability to make a bare-bones project directory in
142-
which you can start developing right away.
140+
We don’t have to go through this whole process every time we want to start a new
141+
project! Cargo has the ability to make a bare-bones project directory in which
142+
we can start developing right away.
143143

144144
To start a new project with Cargo, use `cargo new`:
145145

146146
```bash
147147
$ cargo new hello_world --bin
148148
```
149149

150-
We’re passing `--bin` because our goal is to get straight to making an executable application, as opposed to a library. Executables are often called ‘binaries.’ (as in `/usr/bin`, if you’re on a Unix system)
150+
We’re passing `--bin` because our goal is to get straight to making an
151+
executable application, as opposed to a library. Executables are often called
152+
‘binaries.’ (as in `/usr/bin`, if we’re on a Unix system)
151153

152154
Let's check out what Cargo has generated for us:
153155

@@ -162,7 +164,7 @@ $ tree .
162164
1 directory, 2 files
163165
```
164166

165-
If you don't have the `tree` command, you can probably get it from your
167+
If we don't have the `tree` command, we can probably get it from our
166168
distribution’s package manager. It’s not necessary, but it’s certainly useful.
167169

168170
This is all we need to get started. First, let’s check out `Cargo.toml`:
@@ -176,8 +178,8 @@ authors = ["Your Name <[email protected]>"]
176178
```
177179

178180
Cargo has populated this file with reasonable defaults based off the arguments
179-
you gave it and your `git` global configuration. You may notice that Cargo has
180-
also initialized the `hello_world` directory as a `git` repository.
181+
we gave it and our `git` global configuration. We may notice that Cargo has also
182+
initialized the `hello_world` directory as a `git` repository.
181183

182184
Here’s what’s in `src/main.rs`:
183185

@@ -187,20 +189,21 @@ fn main() {
187189
}
188190
```
189191

190-
Cargo has generated a "Hello World!" for us, and you’re ready to start coding! Cargo
191-
has its own [guide][guide] which covers Cargo’s features in much more depth.
192+
Cargo has generated a "Hello World!" for us, and we’re ready to start coding!
193+
Cargo has its own [guide][guide] which covers Cargo’s features in much more
194+
depth.
192195

193196
[guide]: http://doc.crates.io/guide.html
194197

195-
Now that you’ve got the tools down, let’s actually learn more about the Rust
196-
language itself. These are the basics that will serve you well through the rest
197-
of your time with Rust.
198+
Now that we’ve got the tools down, let’s actually learn more about the Rust
199+
language itself. These are the basics that will serve us well through the rest
200+
of our time with Rust.
198201

199-
You have two options: Dive into a project with ‘[Learn Rust][learnrust]’, or
200-
start from the bottom and work your way up with ‘[Syntax and
201-
Semantics][syntax]’. More experienced systems programmers will probably prefer
202-
‘Learn Rust’, while those from dynamic backgrounds may enjoy either. Different
203-
people learn differently! Choose whatever’s right for you.
202+
We have two options: Dive into a project with ‘[Learn Rust][learnrust]’, or
203+
start from the bottom and work our way up with ‘[Syntax and Semantics][syntax]’.
204+
More experienced systems programmers will probably prefer ‘Learn Rust’, while
205+
those from dynamic backgrounds may enjoy either. Different people learn
206+
differently! Choose whatever’s right for us.
204207

205208
[learnrust]: learn-rust.html
206209
[syntax]: syntax-and-semantics.html

0 commit comments

Comments
 (0)