Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in c-tips #128

Merged
merged 4 commits into from
Feb 13, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/c-tips/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ highlight how things you might already be used to in C are different in Rust.

## Preprocessor

In embedded C it is very common to use the preprocessor for a varity of
In embedded C it is very common to use the preprocessor for a variety of
purposes, such as:

* Compile-time selection of code blocks with `#ifdef`
Expand Down Expand Up @@ -52,7 +52,7 @@ pub mod iir;
```

You can similarly include code blocks only if a feature is _not_ enabled, or if
any combination or features is or is not enabled.
any combination of features are or are not enabled.

Additionally, Rust provides a number of automatically-set conditions you can
use, such as `target_arch` to select different code based on architecture. For
Expand All @@ -62,7 +62,7 @@ full details of the conditional compilation support, refer to the
[conditional compilation]: https://doc.rust-lang.org/reference/conditional-compilation.html

The conditional compilation will only apply to the next statement or block. If
a block can not be used in the current scope then then `cfg` attribute will
a block can not be used in the current scope then `cfg` attribute will
krepl marked this conversation as resolved.
Show resolved Hide resolved
need to be used multiple times. It's worth noting that most of the time it is
better to simply include all the code and allow the compiler to remove dead
code when optimising: it's simpler for you and your users, and in general the
Expand Down