Skip to content

copy description.md and metadata.yml to .meta directory #285

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

Merged
merged 1 commit into from
May 9, 2017
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
9 changes: 9 additions & 0 deletions exercises/luhn-from/.meta/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Luhn: Using the From Trait

Before doing this exercise you should probably do the original Luhn exercise. If you have not completed Luhn, you can get it by running the command:

> `exercism fetch rust luhn`

In the original Luhn exercise you only validated strings, but the Luhn algorithm can be applied to integers as well.

In this exercise you'll implement the [From trait](https://doc.rust-lang.org/std/convert/trait.From.html) to convert strings, strs and unsigned integers into a Struct that performs the validation.
3 changes: 3 additions & 0 deletions exercises/luhn-from/.meta/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
blurb: "Luhn: Using the From Trait"
source: "The Rust track maintainers, based on the original Luhn exercise"
17 changes: 17 additions & 0 deletions exercises/luhn-trait/.meta/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Luhn: Using a Custom Trait

Before doing this exercise you should probably do the original Luhn exercise and its successor, "Luhn: Using the From Trait"

To get the original Luhn exercise, run `exercism fetch rust luhn`

To get the "Luhn: Using the From Trait" exercise, run `exercism fetch rust luhn-from`

In the original Luhn exercise you only validated strings, but the Luhn algorithm can be applied to integers as well.

In "Luhn: Using the From Trait" you implemented a From trait, which also required you to create a Luhn struct.

Instead of creating a Struct just to perform the validation, what if you you validated the primitives (i.e, String, u8, etc.) themselves?

In this exercise you'll create and implement a custom [trait](https://doc.rust-lang.org/book/traits.html) that performs the validation.

Note: It is [not idiomatic Rust to implement traits on on primitives](https://doc.rust-lang.org/book/traits.html#rules-for-implementing-traits). In this exercise we're showing something that you _can_ do, not something you _should_ do. If you find yourself implementing traits on primitives, perhaps you have a case of [Primitive Obsession](http://wiki.c2.com/?PrimitiveObsession).
3 changes: 3 additions & 0 deletions exercises/luhn-trait/.meta/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
blurb: "Luhn: Using a Custom Trait"
source: "The Rust track maintainters, based on the original Luhn exercise"