Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Note that:
tests/exercise-name.rs <- a test suite
src/lib.rs <- an empty file or with exercise stubs
example.rs <- example solution that satisfies tests
Cargo.toml <- with version equal to exercise defintion
Cargo.toml <- with version equal to exercise definition
Cargo.lock <- Auto generated
README.md <- Instructions for the exercise (see notes below)

Expand All @@ -90,15 +90,15 @@ Note that:
- If porting an existing exercise from problem-specifications that has a `canonical-data.json` file, use the version in `canonical-data.json` for that exercise as your `Cargo.toml` version. Otherwise, use "0.0.0".

- An exercise may contain `.meta/hints.md`. This is optional and will appear after the normal exercise
instructions if present. Rust is different in many ways from other languages. This is a place where the differences required for Rust are explained. If it is a large change, you may want to call this out as a comment at the top of `src/lib.rs`, so the user recognises to read this section before starting.
instructions if present. Rust is different in many ways from other languages. This is a place where the differences required for Rust are explained. If it is a large change, you may want to call this out as a comment at the top of `src/lib.rs`, so the user recognizes to read this section before starting.

- If the test suite is appreciably sped up by running in release mode, and there is reason to be confident that the example implementation does not contain any overflow errors, consider adding a file `.meta/test-in-release-mode`. This should contain brief comments explaining the situation.

- If your exercise implements macro-based testing (see [#392](https://github.com/exercism/rust/issues/392#issuecomment-343865993) and [`perfect-numbers.rs`](https://github.com/exercism/rust/blob/master/exercises/perfect-numbers/tests/perfect-numbers.rs)), you will likely run afoul of a CI check which counts the `#[ignore]` lines and compares the result to the number of `#[test]` lines. To fix this, add a file `.meta/ignore-count-ignores` to disable that check for your exercise.

- `README.md` may be [regenerated](https://github.com/exercism/docs/blob/master/maintaining-a-track/regenerating-exercise-readmes.md) from Exercism data. The generator will use the `description.md` from the exercise directory in the [problem-specifications repository](https://github.com/exercism/problem-specifications/tree/master/exercises), then any hints in `.meta/hints.md`, then the [Rust-specific instructions](https://github.com/exercism/rust/blob/master/config/exercise-readme-insert.md). The `## Source` section comes from the `metadata.yml` in the same directory. Convention is that the description of the source remains text and the link is both name and hyperlink of the markdown link.

- Be sure to add the exercise to an appropriate place in the `config.json` file. The position in the file determines the order exercises are sent. Generate a unique UUID for the exercise. Current difficuly levels in use are 1, 4, 7 and 10.
- Be sure to add the exercise to an appropriate place in the `config.json` file. The position in the file determines the order exercises are sent. Generate a unique UUID for the exercise. Current difficulty levels in use are 1, 4, 7 and 10.

## Rust icon
The Rust Logo is created by the Mozilla Corporation, and has been released under the [Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by/4.0/).
Expand Down
2 changes: 1 addition & 1 deletion exercises/crypto-square/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ chunks with a single trailing space.
```

Notice that were we to stack these, we could visually decode the
cyphertext back in to the original message:
ciphertext back in to the original message:

```text
"imtgdvs"
Expand Down
2 changes: 1 addition & 1 deletion exercises/diamond/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn get_diamond(diamond_char: char) -> Vec<String> {

//build second half
let mut rev = result.clone();
rev.pop(); //remove middle pice to avoid duplicates
rev.pop(); //remove middle piece to avoid duplicates
for line in rev.drain(..).rev() {
result.push(line);
}
Expand Down
4 changes: 2 additions & 2 deletions exercises/dominoes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Make a chain of dominoes.

Compute a way to order a given set of dominoes in such a way that they form a
correct domino chain (the dots on one half of a stone match the dots on the
neighbouring half of an adjacent stone) and that dots on the halfs of the stones
which don't have a neighbour (the first and last stone) match each other.
neighbouring half of an adjacent stone) and that dots on the halves of the
stones which don't have a neighbour (the first and last stone) match each other.

For example given the stones `[2|1]`, `[2|3]` and `[1|3]` you should compute something
like `[1|2] [2|3] [3|1]` or `[3|2] [2|1] [1|3]` or `[1|3] [3|2] [2|1]` etc, where the first and last numbers are the same.
Expand Down
2 changes: 1 addition & 1 deletion exercises/dot-dsl/.meta/ALLOWED_TO_NOT_COMPILE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Stub does not compile because not every module and struct method were implemented.
This exercise is an itroduction to modules system and builder pattern, therefore
This exercise is an introduction to modules system and builder pattern, therefore
implementing very module in the stub reduces student learning.
4 changes: 2 additions & 2 deletions exercises/grep/.meta/hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ To learn more about the crate refer to the [failure documentation](https://boats
### Additional reading

While this exercise asks you to implement only the most basic functions of `grep`,
there is acually a project to fully re-implement `grep` in Rust - [ripgrep](https://github.com/BurntSushi/ripgrep).
there is actually a project to fully re-implement `grep` in Rust - [ripgrep](https://github.com/BurntSushi/ripgrep).

If you liked the concept of rewriting the basic util programms in Rust be sure to check the following projects:
If you liked the concept of rewriting the basic util programs in Rust be sure to check the following projects:
- [fd](https://github.com/sharkdp/fd) - a clone of `find`
- [exa](https://github.com/ogham/exa) - a clone of `ls`
- [bat](https://github.com/sharkdp/bat) - a clone of `cat`
Expand Down
4 changes: 2 additions & 2 deletions exercises/grep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ To learn more about the crate refer to the [failure documentation](https://boats
### Additional reading

While this exercise asks you to implement only the most basic functions of `grep`,
there is acually a project to fully re-implement `grep` in Rust - [ripgrep](https://github.com/BurntSushi/ripgrep).
there is actually a project to fully re-implement `grep` in Rust - [ripgrep](https://github.com/BurntSushi/ripgrep).

If you liked the concept of rewriting the basic util programms in Rust be sure to check the following projects:
If you liked the concept of rewriting the basic util programs in Rust be sure to check the following projects:
- [fd](https://github.com/sharkdp/fd) - a clone of `find`
- [exa](https://github.com/ogham/exa) - a clone of `ls`
- [bat](https://github.com/sharkdp/bat) - a clone of `cat`
Expand Down
2 changes: 1 addition & 1 deletion exercises/luhn-trait/.meta/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
blurb: "Luhn: Using a Custom Trait"
source: "The Rust track maintainters, based on the original Luhn exercise"
source: "The Rust track maintainers, based on the original Luhn exercise"
2 changes: 1 addition & 1 deletion exercises/luhn-trait/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]

## Source

The Rust track maintainters, based on the original Luhn exercise
The Rust track maintainers, based on the original Luhn exercise

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
2 changes: 1 addition & 1 deletion exercises/nucleotide-codons/tests/codons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn test_isoleucine() {
#[test]
#[ignore]
fn test_arginine_name() {
// In arginine CGA can be "compresed" both as CGN and as MGR
// In arginine CGA can be "compressed" both as CGN and as MGR
let info = codons::parse(make_pairs());
assert_eq!(info.name_for("CGA"), Ok("arginine"));
assert_eq!(info.name_for("CGN"), Ok("arginine"));
Expand Down
2 changes: 1 addition & 1 deletion exercises/ocr-numbers/tests/ocr-numbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn input_with_columns_not_multiple_of_three_is_error() {
#[test]
#[ignore]
#[cfg_attr(rustfmt, rustfmt_skip)]
fn unrecognized_chararcters_return_question_mark() {
fn unrecognized_characters_return_question_mark() {
let input = " \n".to_string() +
" _\n" +
" |\n" +
Expand Down
2 changes: 1 addition & 1 deletion exercises/react/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl<'a, T: Copy + PartialEq> Reactor<'a, T> {

let (new_value, dependents) = {
// This block limits the scope of the self.cells borrow.
// This is necessary becaue we borrow it mutably below.
// This is necessary because we borrow it mutably below.
let (dependencies, f, dependents) = match self.computes.get(id) {
Some(c) => (&c.dependencies, &c.f, c.cell.dependents.clone()),
None => panic!("Cell to update disappeared while querying"),
Expand Down
2 changes: 1 addition & 1 deletion exercises/rectangles/tests/rectangles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn rectangle_of_width_1() {

#[test]
#[ignore]
fn unit_equare() {
fn unit_square() {
let lines = &[
"++",
"++"
Expand Down
2 changes: 1 addition & 1 deletion exercises/rna-transcription/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub enum Nucleotide {
}

impl Nucleotide {
/// Parses a nucleotode from its character value, if valid.
/// Parses a nucleotide from its character value, if valid.
fn from_char(ch: char) -> Option<Nucleotide> {
Some(match ch {
'A' => Nucleotide::Adenine,
Expand Down
2 changes: 1 addition & 1 deletion exercises/say/tests/say.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate say;

// Note: No tests created using 'and' with numbers.
// Aparently Most American English does not use the 'and' with numbers,
// Apparently Most American English does not use the 'and' with numbers,
// where it is common in British English to use the 'and'.

#[test]
Expand Down
4 changes: 2 additions & 2 deletions exercises/simple-cipher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ for A, and so with the others."

Ciphers are very straight-forward algorithms that allow us to render
text less readable while still allowing easy deciphering. They are
vulnerable to many forms of cryptoanalysis, but we are lucky that
generally our little sisters are not cryptoanalysts.
vulnerable to many forms of cryptanalysis, but we are lucky that
generally our little sisters are not cryptanalysts.

The Caesar Cipher was used for some messages from Julius Caesar that
were sent afield. Now Caesar knew that the cipher wasn't very good, but
Expand Down
2 changes: 1 addition & 1 deletion exercises/triangle/.meta/hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Or maybe you will come up with an approach that uses none of those!
## Non-integer lengths

The base exercise tests identification of triangles whose sides are all
integers. However, some triangles cannot be represented by pure integers. A simple example is a right triangle (an isocoles triangle whose equal sides are separated by 90 degrees) whose equal sides both have length of 1. Its hypotenuse is the square root of 2, which is an irrational number: no simple multiplication can represent this number as an integer.
integers. However, some triangles cannot be represented by pure integers. A simple example is a right triangle (an isosceles triangle whose equal sides are separated by 90 degrees) whose equal sides both have length of 1. Its hypotenuse is the square root of 2, which is an irrational number: no simple multiplication can represent this number as an integer.

It would be tedious to rewrite the analysis functions to handle both integer and floating-point cases, and particularly tedious to do so for all potential integer and floating point types: given signed and unsigned variants of bitwidths 8, 16, 32, 64, and 128, that would be 10 reimplementations of fundamentally the same code even before considering floats!

Expand Down
2 changes: 1 addition & 1 deletion exercises/triangle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Or maybe you will come up with an approach that uses none of those!
## Non-integer lengths

The base exercise tests identification of triangles whose sides are all
integers. However, some triangles cannot be represented by pure integers. A simple example is a right triangle (an isocoles triangle whose equal sides are separated by 90 degrees) whose equal sides both have length of 1. Its hypotenuse is the square root of 2, which is an irrational number: no simple multiplication can represent this number as an integer.
integers. However, some triangles cannot be represented by pure integers. A simple example is a right triangle (an isosceles triangle whose equal sides are separated by 90 degrees) whose equal sides both have length of 1. Its hypotenuse is the square root of 2, which is an irrational number: no simple multiplication can represent this number as an integer.

It would be tedious to rewrite the analysis functions to handle both integer and floating-point cases, and particularly tedious to do so for all potential integer and floating point types: given signed and unsigned variants of bitwidths 8, 16, 32, 64, and 128, that would be 10 reimplementations of fundamentally the same code even before considering floats!

Expand Down
2 changes: 1 addition & 1 deletion exercises/variable-length-quantity/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn to_bytes_single(mut value: u32) -> Vec<u8> {
// over allocates, but avoids growth
let mut res = Vec::with_capacity(4);

// 0 must be handeled specially, because we need to push one byte
// 0 must be handled specially, because we need to push one byte
if value == 0 {
return vec![0];
}
Expand Down