aboutsummaryrefslogtreecommitdiff
path: root/rust/hello-world/README.md
diff options
context:
space:
mode:
authorFederico Igne <git@federicoigne.com>2020-12-26 17:48:38 +0000
committerFederico Igne <git@federicoigne.com>2021-11-03 18:55:08 +0000
commit02481656966b0a8dfc95cf3c22bcc049660ff7d4 (patch)
tree8e39798fcaf27931d91c2088423fd4e97adcfc2d /rust/hello-world/README.md
parent4e2052c4d792540c2f742b2c2a081b11117ed41d (diff)
downloadexercism-02481656966b0a8dfc95cf3c22bcc049660ff7d4.tar.gz
exercism-02481656966b0a8dfc95cf3c22bcc049660ff7d4.zip
Move Rust exercises in a subdirectory
Diffstat (limited to 'rust/hello-world/README.md')
-rw-r--r--rust/hello-world/README.md95
1 files changed, 95 insertions, 0 deletions
diff --git a/rust/hello-world/README.md b/rust/hello-world/README.md
new file mode 100644
index 0000000..775dd89
--- /dev/null
+++ b/rust/hello-world/README.md
@@ -0,0 +1,95 @@
1# Hello World
2
3The classical introductory exercise. Just say "Hello, World!".
4
5["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is
6the traditional first program for beginning programming in a new language
7or environment.
8
9The objectives are simple:
10
11- Write a function that returns the string "Hello, World!".
12- Run the test suite and make sure that it succeeds.
13- Submit your solution and check it at the website.
14
15If everything goes well, you will be ready to fetch your first real exercise.
16
17## Rust Installation
18
19Refer to the [exercism help page][help-page] for Rust installation and learning
20resources.
21
22## Writing the Code
23
24Execute the tests with:
25
26```bash
27$ cargo test
28```
29
30All but the first test have been ignored. After you get the first test to
31pass, open the tests source file which is located in the `tests` directory
32and remove the `#[ignore]` flag from the next test and get the tests to pass
33again. Each separate test is a function with `#[test]` flag above it.
34Continue, until you pass every test.
35
36If you wish to run all ignored tests without editing the tests source file, use:
37
38```bash
39$ cargo test -- --ignored
40```
41
42To run a specific test, for example `some_test`, you can use:
43
44```bash
45$ cargo test some_test
46```
47
48If the specific test is ignored use:
49
50```bash
51$ cargo test some_test -- --ignored
52```
53
54To learn more about Rust tests refer to the [online test documentation][rust-tests]
55
56Make sure to read the [Modules][modules] chapter if you
57haven't already, it will help you with organizing your files.
58
59## Further improvements
60
61After you have solved the exercise, please consider using the additional utilities, described in the [installation guide](https://exercism.io/tracks/rust/installation), to further refine your final solution.
62
63To format your solution, inside the solution directory use
64
65```bash
66cargo fmt
67```
68
69To see, if your solution contains some common ineffective use cases, inside the solution directory use
70
71```bash
72cargo clippy --all-targets
73```
74
75## Submitting the solution
76
77Generally you should submit all files in which you implemented your solution (`src/lib.rs` in most cases). If you are using any external crates, please consider submitting the `Cargo.toml` file. This will make the review process faster and clearer.
78
79## Feedback, Issues, Pull Requests
80
81The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
82
83If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
84
85[help-page]: https://exercism.io/tracks/rust/learning
86[modules]: https://doc.rust-lang.org/book/ch07-02-defining-modules-to-control-scope-and-privacy.html
87[cargo]: https://doc.rust-lang.org/book/ch14-00-more-about-cargo.html
88[rust-tests]: https://doc.rust-lang.org/book/ch11-02-running-tests.html
89
90## Source
91
92This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program)
93
94## Submitting Incomplete Solutions
95It's possible to submit an incomplete solution so you can see how others have completed the exercise.