mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-26 00:11:49 +02:00
Compare commits
386 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ec35d899c | ||
|
|
c811643d1e | ||
|
|
a259704570 | ||
|
|
268822dbd8 | ||
|
|
1237aa574c | ||
|
|
b3734ba310 | ||
|
|
c9b73e412e | ||
|
|
107f1f97d9 | ||
|
|
420729da60 | ||
|
|
452ab26aa7 | ||
|
|
92a5d0037f | ||
|
|
0b7f3fe37a | ||
|
|
cf9f382873 | ||
|
|
8f33dba9ca | ||
|
|
6c87dc8210 | ||
|
|
6c071d4701 | ||
|
|
03ba8836f2 | ||
|
|
4bb94e050b | ||
|
|
51817820f2 | ||
|
|
76a36dd385 | ||
|
|
c39eb3fe55 | ||
|
|
7dcc1fca29 | ||
|
|
887b6e183b | ||
|
|
60bb7cc393 | ||
|
|
43d0623086 | ||
|
|
e6c0d00637 | ||
|
|
b1cdce6289 | ||
|
|
d3c5058d89 | ||
|
|
89650f808a | ||
|
|
0a92262fa0 | ||
|
|
4e2a354716 | ||
|
|
74895df5a7 | ||
|
|
d114847f25 | ||
|
|
4dfd85ff05 | ||
|
|
0bd7a0631a | ||
|
|
bdf6efeccd | ||
|
|
331cdef7e3 | ||
|
|
d4e3d98d0a | ||
|
|
2ca5250f78 | ||
|
|
3f0e1303e0 | ||
|
|
c80ad089fd | ||
|
|
01023f5b4f | ||
|
|
70e29d9717 | ||
|
|
c60bd97cb9 | ||
|
|
d00f0d8c57 | ||
|
|
bf93724511 | ||
|
|
057d912e78 | ||
|
|
e306e23963 | ||
|
|
0232f6058f | ||
|
|
4378d1db46 | ||
|
|
179a75a68d | ||
|
|
17f9d7429c | ||
|
|
c1f35e46df | ||
|
|
cd2b5e8e3b | ||
|
|
dc36ca6d84 | ||
|
|
e96112ab99 | ||
|
|
bc56861744 | ||
|
|
4cde788d33 | ||
|
|
9838892cf3 | ||
|
|
9c5d8ad44c | ||
|
|
a2e74a2a4b | ||
|
|
52c7f8a859 | ||
|
|
4f7ff5d9c7 | ||
|
|
cbcde34540 | ||
|
|
71a06044e6 | ||
|
|
5002c54ffb | ||
|
|
17e3e75331 | ||
|
|
af84359bdb | ||
|
|
74739261d6 | ||
|
|
1622e8c198 | ||
|
|
e06ba1df58 | ||
|
|
7dce8c8b61 | ||
|
|
f61f9f3796 | ||
|
|
6516a89485 | ||
|
|
9b27e8d993 | ||
|
|
f7719a4a9c | ||
|
|
81fb396780 | ||
|
|
8d675198d8 | ||
|
|
969384c258 | ||
|
|
f2650de369 | ||
|
|
acaee79994 | ||
|
|
527a5b1182 | ||
|
|
72b2c9f54f | ||
|
|
8ef4869b26 | ||
|
|
dba759e1c6 | ||
|
|
cb661896a2 | ||
|
|
e08b6cf3ef | ||
|
|
e2fa512e86 | ||
|
|
d1ee2daf14 | ||
|
|
359f81dd0b | ||
|
|
5e5271247a | ||
|
|
71da9068e7 | ||
|
|
b24b295d88 | ||
|
|
1663a16ead | ||
|
|
af91eb508a | ||
|
|
1c0fe3cbcc | ||
|
|
ed7fe883b9 | ||
|
|
ae54c17b6a | ||
|
|
574bbffe0b | ||
|
|
46c28d5cef | ||
|
|
ad338ee789 | ||
|
|
e3cfaa246d | ||
|
|
fed4fe78bb | ||
|
|
bf33829da2 | ||
|
|
d57c183028 | ||
|
|
c2ed98deb3 | ||
|
|
abd6b70c72 | ||
|
|
882d535ba8 | ||
|
|
0de45ccdb7 | ||
|
|
ab5ecbee7a | ||
|
|
e106d7a4f4 | ||
|
|
d75759e829 | ||
|
|
db9d7a907d | ||
|
|
a1b9c50f36 | ||
|
|
c4b59aa593 | ||
|
|
4a18bdeefe | ||
|
|
1caef0b434 | ||
|
|
ae56cba9c8 | ||
|
|
3352b5a4d3 | ||
|
|
24762434ff | ||
|
|
e9c0ca6be2 | ||
|
|
9ef63c0b9b | ||
|
|
06d5c0973a | ||
|
|
8d82856233 | ||
|
|
9ddd4ca33a | ||
|
|
fe726f5bca | ||
|
|
0a11bad714 | ||
|
|
a7dc080b95 | ||
|
|
74af578beb | ||
|
|
6efa7d5d15 | ||
|
|
a6774100d4 | ||
|
|
de22b13273 | ||
|
|
6c41adef63 | ||
|
|
1c3beb0a59 | ||
|
|
e4e9e4c963 | ||
|
|
44d8047249 | ||
|
|
5423f1be29 | ||
|
|
dfd2fab4f3 | ||
|
|
96fc301764 | ||
|
|
5bdb5de855 | ||
|
|
a64dbdcc04 | ||
|
|
2f0ff258b1 | ||
|
|
1cd9328a58 | ||
|
|
ec527824b4 | ||
|
|
380587f120 | ||
|
|
ba8f97f418 | ||
|
|
03131a3d35 | ||
|
|
df25684cb7 | ||
|
|
8e313cffaa | ||
|
|
6948905716 | ||
|
|
ba087ce64a | ||
|
|
3b03865a62 | ||
|
|
33fa274bbf | ||
|
|
23f700dc23 | ||
|
|
d876649616 | ||
|
|
e4c14ac76e | ||
|
|
b438049c39 | ||
|
|
b017579577 | ||
|
|
c8e4b357a3 | ||
|
|
8774e47dc3 | ||
|
|
e422ab1507 | ||
|
|
cdd8e19716 | ||
|
|
91d86a1de9 | ||
|
|
6a10f900b4 | ||
|
|
9b9a89c79a | ||
|
|
123e6426d1 | ||
|
|
427ec6b2e4 | ||
|
|
03dcb582e6 | ||
|
|
1043a06124 | ||
|
|
d20e413a68 | ||
|
|
9bf4c5e8df | ||
|
|
633303d4b8 | ||
|
|
a4a1098766 | ||
|
|
0bd459dcac | ||
|
|
3b4514b686 | ||
|
|
2e05606edc | ||
|
|
c8c1b87a01 | ||
|
|
34ea029df8 | ||
|
|
3a4433d5a2 | ||
|
|
2dc93cadda | ||
|
|
de6c45ad24 | ||
|
|
fadade8592 | ||
|
|
d91044f3a2 | ||
|
|
a3ea37b76e | ||
|
|
ec63cadadb | ||
|
|
84d8305730 | ||
|
|
73777980f1 | ||
|
|
75788b1148 | ||
|
|
dd9b2ddc89 | ||
|
|
b7ddd09fab | ||
|
|
48ffcbd2c4 | ||
|
|
68d3ac567c | ||
|
|
50ab289da6 | ||
|
|
4e079fdd08 | ||
|
|
91fc9e3118 | ||
|
|
a2f0401c4c | ||
|
|
1b85828548 | ||
|
|
4c46e5e1a3 | ||
|
|
4da9e7ee29 | ||
|
|
72e615aa7a | ||
|
|
cd02abc481 | ||
|
|
399ab328d8 | ||
|
|
809ec2ce01 | ||
|
|
11d2cf0d60 | ||
|
|
dbb2624403 | ||
|
|
4d4fa77459 | ||
|
|
3145794084 | ||
|
|
d9b69bd1a0 | ||
|
|
7cd635fa84 | ||
|
|
ce40e201f0 | ||
|
|
404f3ef465 | ||
|
|
e1be594fdd | ||
|
|
9569c9a9e7 | ||
|
|
f78c480208 | ||
|
|
8794b40bc6 | ||
|
|
86cc85295a | ||
|
|
166a53946c | ||
|
|
91530f5716 | ||
|
|
9b8de65525 | ||
|
|
650b1dee54 | ||
|
|
21c9f44168 | ||
|
|
7f0d2c2bf0 | ||
|
|
6b6dc9dd48 | ||
|
|
3a9ec4192d | ||
|
|
4f7dbbd2c3 | ||
|
|
8c37db1a23 | ||
|
|
c6b7ad8878 | ||
|
|
4a384cae4a | ||
|
|
84461c20cb | ||
|
|
3cddda56fc | ||
|
|
37f3069a67 | ||
|
|
2b2fbe918e | ||
|
|
cf42ddc449 | ||
|
|
eefa656232 | ||
|
|
249ad44cc0 | ||
|
|
54804e344d | ||
|
|
1c334de6fd | ||
|
|
f253103a31 | ||
|
|
1120db57a6 | ||
|
|
afa661cff4 | ||
|
|
347f30bd86 | ||
|
|
127773f3f5 | ||
|
|
8d0490bd70 | ||
|
|
293dfb35d5 | ||
|
|
81be404487 | ||
|
|
6177b6e126 | ||
|
|
79cc657917 | ||
|
|
7928122fce | ||
|
|
9c88ea9126 | ||
|
|
2b766ef9f9 | ||
|
|
bd3d9ac9d5 | ||
|
|
aa0db8379c | ||
|
|
eadd41a9ec | ||
|
|
fab2eb9833 | ||
|
|
6bd791f2f4 | ||
|
|
ec5f80dce1 | ||
|
|
65cdc856ae | ||
|
|
472f61485e | ||
|
|
b4de659438 | ||
|
|
a37a8818c8 | ||
|
|
bdf01aa174 | ||
|
|
a941c69f09 | ||
|
|
72aaa15e6a | ||
|
|
3a06de71a8 | ||
|
|
5e2b39a5c1 | ||
|
|
63c942233e | ||
|
|
2612edc133 | ||
|
|
e2ce9f42b5 | ||
|
|
1c6f7e4b7b | ||
|
|
e2c41903ad | ||
|
|
bd48544e25 | ||
|
|
c0e3daacaf | ||
|
|
f2ad3a6a0b | ||
|
|
caf921a01f | ||
|
|
b790bafc02 | ||
|
|
ad3cd54cce | ||
|
|
1a6a725f88 | ||
|
|
1ad20d94ff | ||
|
|
995c6f0fb1 | ||
|
|
c3e7b83178 | ||
|
|
2e93a588e0 | ||
|
|
9aeca3f97e | ||
|
|
2193fff4bb | ||
|
|
aec2c65c63 | ||
|
|
a6509cc4d5 | ||
|
|
a02b279750 | ||
|
|
ece841f5ce | ||
|
|
2a6e4dc8a6 | ||
|
|
c163011cc0 | ||
|
|
b350945a16 | ||
|
|
1ef368a69d | ||
|
|
8dc587b01a | ||
|
|
550c4293ed | ||
|
|
3df094713f | ||
|
|
01e7f27aa6 | ||
|
|
8d62a99637 | ||
|
|
ab9995e76e | ||
|
|
bef39b1259 | ||
|
|
0d894e6ff7 | ||
|
|
be9510539e | ||
|
|
3bce2ef8d6 | ||
|
|
aa9a943ddf | ||
|
|
ebdb66c7bf | ||
|
|
9f3e8c2dde | ||
|
|
96c56ab08a | ||
|
|
04dbf03ace | ||
|
|
05a753fe63 | ||
|
|
815edb7003 | ||
|
|
5157f56875 | ||
|
|
3f5abca215 | ||
|
|
833df0b8b3 | ||
|
|
6742860ea5 | ||
|
|
797e6d45c0 | ||
|
|
320de0d921 | ||
|
|
5eed505d74 | ||
|
|
91ee27f22b | ||
|
|
5f7c89f85d | ||
|
|
c6712dfccd | ||
|
|
baf4ba175b | ||
|
|
b29ea17ea9 | ||
|
|
ab57c26cf9 | ||
|
|
98e5e8835e | ||
|
|
f5158ece1a | ||
|
|
d65b4a9a93 | ||
|
|
8404947bc0 | ||
|
|
2e84f34cf3 | ||
|
|
726805f064 | ||
|
|
b4a4138559 | ||
|
|
f1d2b3a39a | ||
|
|
1f9d006858 | ||
|
|
cc266d7d80 | ||
|
|
fff72afe2e | ||
|
|
c1abd13b5c | ||
|
|
75802c14b2 | ||
|
|
cddc1e86e7 | ||
|
|
24ea42ce61 | ||
|
|
6102e612fa | ||
|
|
52bde71166 | ||
|
|
15a79cfe9c | ||
|
|
15e71535f3 | ||
|
|
9f988bfe29 | ||
|
|
e8d1baa4b5 | ||
|
|
8bbe4ff138 | ||
|
|
0b9220c1fc | ||
|
|
0d65753fdb | ||
|
|
4f1374a6e7 | ||
|
|
5a0521e92c | ||
|
|
fea86c29d6 | ||
|
|
9c4614f7e6 | ||
|
|
c24a78ae94 | ||
|
|
621816fb56 | ||
|
|
cfae54d361 | ||
|
|
7857b0a689 | ||
|
|
10965920fb | ||
|
|
d2e7ecabd8 | ||
|
|
5772589dc3 | ||
|
|
6df08b411b | ||
|
|
c355ac6593 | ||
|
|
e9b42bbc2a | ||
|
|
1283aa3bd8 | ||
|
|
ff6cba7205 | ||
|
|
d0107f7921 | ||
|
|
644c49f1e0 | ||
|
|
a303d508cf | ||
|
|
44d39112ff | ||
|
|
28020d0c54 | ||
|
|
0ef95947cc | ||
|
|
4ac70a99ae | ||
|
|
bcf14cf677 | ||
|
|
1dae782cd4 | ||
|
|
90cfb6ff28 | ||
|
|
26110da7ca | ||
|
|
30644c9a06 | ||
|
|
033bf1198f | ||
|
|
cdc7d92e57 | ||
|
|
af0e3b8f17 | ||
|
|
04f1d079aa | ||
|
|
9b6c629397 | ||
|
|
5aa467bef2 | ||
|
|
af7ad27f89 | ||
|
|
d6d57bfbb8 | ||
|
|
4f4cfcf3c3 | ||
|
|
fa9f522b7f | ||
|
|
838f9f3008 | ||
|
|
96347df9df | ||
|
|
9334783da3 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"files": [
|
||||
"README.md"
|
||||
"AUTHORS.md"
|
||||
],
|
||||
"imageSize": 100,
|
||||
"commit": false,
|
||||
@@ -637,6 +637,524 @@
|
||||
"contributions": [
|
||||
"maintenance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "pcn",
|
||||
"name": "Peter N",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/1056756?v=4",
|
||||
"profile": "https://github.com/pcn",
|
||||
"contributions": [
|
||||
"maintenance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "seancad",
|
||||
"name": "seancad",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/47405611?v=4",
|
||||
"profile": "https://github.com/seancad",
|
||||
"contributions": [
|
||||
"maintenance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "wsh",
|
||||
"name": "Will Hayworth",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/181174?v=4",
|
||||
"profile": "http://willhayworth.com",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "chrizel",
|
||||
"name": "Christian Zeller",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/20802?v=4",
|
||||
"profile": "https://github.com/chrizel",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jfchevrette",
|
||||
"name": "Jean-Francois Chevrette",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/3001?v=4",
|
||||
"profile": "https://github.com/jfchevrette",
|
||||
"contributions": [
|
||||
"content",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jbaber",
|
||||
"name": "John Baber-Lucero",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1908117?v=4",
|
||||
"profile": "https://github.com/jbaber",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tal-zvon",
|
||||
"name": "Tal",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/3195851?v=4",
|
||||
"profile": "https://github.com/tal-zvon",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "apogeeoak",
|
||||
"name": "apogeeoak",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/59737221?v=4",
|
||||
"profile": "https://github.com/apogeeoak",
|
||||
"contributions": [
|
||||
"content",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Crell",
|
||||
"name": "Larry Garfield",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/254863?v=4",
|
||||
"profile": "http://www.garfieldtech.com/",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "circumspect",
|
||||
"name": "circumspect",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/40770208?v=4",
|
||||
"profile": "https://github.com/circumspect",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "cjwyett",
|
||||
"name": "Cyrus Wyett",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/34195737?v=4",
|
||||
"profile": "https://github.com/cjwyett",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "cadolphs",
|
||||
"name": "cadolphs",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/13894820?v=4",
|
||||
"profile": "https://github.com/cadolphs",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "hpwxf",
|
||||
"name": "Pascal H.",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/26146722?v=4",
|
||||
"profile": "https://www.haveneer.com",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "chapeupreto",
|
||||
"name": "Rod Elias",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/834048?v=4",
|
||||
"profile": "https://twitter.com/chapeupreto",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "blerchy",
|
||||
"name": "Matt Lebl",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/2555355?v=4",
|
||||
"profile": "https://github.com/blerchy",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "flakolefluk",
|
||||
"name": "Ignacio Le Fluk",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/11986564?v=4",
|
||||
"profile": "http://flakolefluk.dev",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tlyu",
|
||||
"name": "Taylor Yu",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/431873?v=4",
|
||||
"profile": "https://github.com/tlyu",
|
||||
"contributions": [
|
||||
"code",
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Zerotask",
|
||||
"name": "Patrick Hintermayer",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/20150243?v=4",
|
||||
"profile": "https://zerotask.github.io",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "arthas168",
|
||||
"name": "Pete Pavlovski",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/32264020?v=4",
|
||||
"profile": "https://petkopavlovski.com/",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "k12ish",
|
||||
"name": "k12ish",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/45272873?v=4",
|
||||
"profile": "https://github.com/k12ish",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "hongshaoyang",
|
||||
"name": "Shao Yang Hong",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/19281800?v=4",
|
||||
"profile": "https://github.com/hongshaoyang",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "bmacer",
|
||||
"name": "Brandon Macer",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/13931806?v=4",
|
||||
"profile": "https://github.com/bmacer",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "stoiandan",
|
||||
"name": "Stoian Dan",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/10388612?v=4",
|
||||
"profile": "https://github.com/stoiandan",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "PiDelport",
|
||||
"name": "Pi Delport",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/630271?v=4",
|
||||
"profile": "https://about.me/pjdelport",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "sateeshkumarb",
|
||||
"name": "Sateesh ",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/429263?v=4",
|
||||
"profile": "https://github.com/sateeshkumarb",
|
||||
"contributions": [
|
||||
"code",
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kayuapi",
|
||||
"name": "ZC",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/10304328?v=4",
|
||||
"profile": "https://github.com/kayuapi",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "hyperparabolic",
|
||||
"name": "hyperparabolic",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/12348474?v=4",
|
||||
"profile": "https://github.com/hyperparabolic",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kolbma",
|
||||
"name": "arlecchino",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5228369?v=4",
|
||||
"profile": "https://www.net4visions.at",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jazzplato",
|
||||
"name": "Richthofen",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/7576730?v=4",
|
||||
"profile": "https://richthofen.io/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "cseltol",
|
||||
"name": "Ivan Nerazumov",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/64264529?v=4",
|
||||
"profile": "https://github.com/cseltol",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "lauralindzey",
|
||||
"name": "lauralindzey",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/65185744?v=4",
|
||||
"profile": "https://github.com/lauralindzey",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "sinharaksh1t",
|
||||
"name": "Rakshit Sinha",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/28585848?v=4",
|
||||
"profile": "https://github.com/sinharaksh1t",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "dbednar230",
|
||||
"name": "Damian",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/54457902?v=4",
|
||||
"profile": "https://github.com/dbednar230",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "benarmstead",
|
||||
"name": "Ben Armstead",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/70973680?v=4",
|
||||
"profile": "https://benarmstead.co.uk",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "anuk909",
|
||||
"name": "anuk909",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/34924662?v=4",
|
||||
"profile": "https://github.com/anuk909",
|
||||
"contributions": [
|
||||
"content",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "granddaifuku",
|
||||
"name": "granddaifuku",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/49578068?v=4",
|
||||
"profile": "https://granddaifuku.com/",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Weilet",
|
||||
"name": "Weilet",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/32561597?v=4",
|
||||
"profile": "https://weilet.me",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Millione",
|
||||
"name": "LIU JIE",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/38575932?v=4",
|
||||
"profile": "https://github.com/Millione",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "abusch",
|
||||
"name": "Antoine Büsch",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/506344?v=4",
|
||||
"profile": "https://github.com/abusch",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "frogtd",
|
||||
"name": "frogtd",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/31412003?v=4",
|
||||
"profile": "https://frogtd.com/",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "EmisonLu",
|
||||
"name": "Zhenghao Lu",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/54395432?v=4",
|
||||
"profile": "https://github.com/EmisonLu",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "fredr",
|
||||
"name": "Fredrik Enestad",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/762956?v=4",
|
||||
"profile": "https://soundtrackyourbrand.com",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "xuesongbj",
|
||||
"name": "xuesong",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/18476085?v=4",
|
||||
"profile": "http://xuesong.pydevops.com",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "MpdWalsh",
|
||||
"name": "Michael Walsh",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/48160144?v=4",
|
||||
"profile": "https://github.com/MpdWalsh",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "alirezaghey",
|
||||
"name": "alirezaghey",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/26653424?v=4",
|
||||
"profile": "https://github.com/alirezaghey",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "frvannes16",
|
||||
"name": "Franklin van Nes",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/3188475?v=4",
|
||||
"profile": "https://github.com/frvannes16",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "nekonako",
|
||||
"name": "nekonako",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/46141275?v=4",
|
||||
"profile": "https://nekonako.github.io",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tan-zx",
|
||||
"name": "ZX",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/67887489?v=4",
|
||||
"profile": "https://github.com/tan-zx",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "sundevilyang",
|
||||
"name": "Yang Wen",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1499214?v=4",
|
||||
"profile": "https://github.com/sundevilyang",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "highb",
|
||||
"name": "Brandon High",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/759848?v=4",
|
||||
"profile": "https://brandon-high.com",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "x-hgg-x",
|
||||
"name": "x-hgg-x",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/39058530?v=4",
|
||||
"profile": "https://github.com/x-hgg-x",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "KisaragiEffective",
|
||||
"name": "Kisaragi",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/48310258?v=4",
|
||||
"profile": "http://kisaragieffective.github.io",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Kallu-A",
|
||||
"name": "Lucas Aries",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/73198738?v=4",
|
||||
"profile": "https://github.com/Kallu-A",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ragreenburg",
|
||||
"name": "ragreenburg",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/24358100?v=4",
|
||||
"profile": "https://github.com/ragreenburg",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "stevenfukase",
|
||||
"name": "stevenfukase",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/66785624?v=4",
|
||||
"profile": "https://github.com/stevenfukase",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "J-S-Kim",
|
||||
"name": "J-S-Kim",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/17569303?v=4",
|
||||
"profile": "https://github.com/J-S-Kim",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Fointard",
|
||||
"name": "Fointard",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9333398?v=4",
|
||||
"profile": "https://github.com/Fointard",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 8,
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[clog]
|
||||
|
||||
repository = "https://github.com/rust-lang/rustlings"
|
||||
changelog = "CHANGELOG.md"
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ exercises/clippy/Cargo.toml
|
||||
exercises/clippy/Cargo.lock
|
||||
.idea
|
||||
.vscode
|
||||
*.iml
|
||||
|
||||
176
AUTHORS.md
Normal file
176
AUTHORS.md
Normal file
@@ -0,0 +1,176 @@
|
||||
## Authors
|
||||
|
||||
This file lists the people that have contributed to this project.
|
||||
|
||||
Excluded from this list are @carols10cents and @diannasoreil, the principal
|
||||
authors.
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="http://carol-nichols.com"><img src="https://avatars2.githubusercontent.com/u/193874?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Carol (Nichols || Goulding)</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=carols10cents" title="Code">💻</a> <a href="#content-carols10cents" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://twitter.com/QuietMisdreavus"><img src="https://avatars2.githubusercontent.com/u/5217170?v=4?s=100" width="100px;" alt=""/><br /><sub><b>QuietMisdreavus</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=QuietMisdreavus" title="Code">💻</a> <a href="#content-QuietMisdreavus" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/robertlugg"><img src="https://avatars0.githubusercontent.com/u/6054540?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Robert M Lugg</b></sub></a><br /><a href="#content-robertlugg" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://hynek.me/about/"><img src="https://avatars3.githubusercontent.com/u/41240?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Hynek Schlawack</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=hynek" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://spacekookie.de"><img src="https://avatars0.githubusercontent.com/u/7669898?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Katharina Fey</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=spacekookie" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/lukabavdaz"><img src="https://avatars0.githubusercontent.com/u/9624558?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lukabavdaz</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=lukabavdaz" title="Code">💻</a> <a href="#content-lukabavdaz" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://vestera.as"><img src="https://avatars2.githubusercontent.com/u/4187449?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Erik Vesteraas</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=evestera" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/Delet0r"><img src="https://avatars1.githubusercontent.com/u/23195618?v=4?s=100" width="100px;" alt=""/><br /><sub><b>delet0r</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Delet0r" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://phinary.ca"><img src="https://avatars1.githubusercontent.com/u/10522375?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shaun Bennett</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=shaunbennett" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/abagshaw"><img src="https://avatars2.githubusercontent.com/u/8594541?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrew Bagshaw</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=abagshaw" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://ai6ua.net/"><img src="https://avatars2.githubusercontent.com/u/175578?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kyle Isom</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=kisom" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/ColinPitrat"><img src="https://avatars3.githubusercontent.com/u/1541863?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Colin Pitrat</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=ColinPitrat" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://zacanger.com"><img src="https://avatars3.githubusercontent.com/u/12520493?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zac Anger</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=zacanger" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/mgeier"><img src="https://avatars1.githubusercontent.com/u/705404?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matthias Geier</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=mgeier" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/cjpearce"><img src="https://avatars1.githubusercontent.com/u/3453268?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chris Pearce</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=cjpearce" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://yvan-sraka.github.io"><img src="https://avatars2.githubusercontent.com/u/705213?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yvan Sraka</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=yvan-sraka" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/dendi239"><img src="https://avatars3.githubusercontent.com/u/16478650?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Denys Smirnov</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=dendi239" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/eddyp"><img src="https://avatars2.githubusercontent.com/u/123772?v=4?s=100" width="100px;" alt=""/><br /><sub><b>eddyp</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=eddyp" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://about.me/BrianKung"><img src="https://avatars1.githubusercontent.com/u/2836167?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Brian Kung</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=briankung" title="Code">💻</a> <a href="#content-briankung" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://rcousineau.gitlab.io"><img src="https://avatars3.githubusercontent.com/u/281039?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Russell</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=miller-time" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://danwilhelm.com"><img src="https://avatars3.githubusercontent.com/u/6137185?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dan Wilhelm</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=danwilhelm" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/Jesse-Cameron"><img src="https://avatars3.githubusercontent.com/u/3723654?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jesse</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Jesse-Cameron" title="Code">💻</a> <a href="#content-Jesse-Cameron" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/MrFroop"><img src="https://avatars3.githubusercontent.com/u/196700?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fredrik Jambrén</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=MrFroop" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/petemcfarlane"><img src="https://avatars3.githubusercontent.com/u/3472717?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pete McFarlane</b></sub></a><br /><a href="#content-petemcfarlane" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/nkanderson"><img src="https://avatars0.githubusercontent.com/u/4128825?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nkanderson</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=nkanderson" title="Code">💻</a> <a href="#content-nkanderson" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/ajaxm"><img src="https://avatars0.githubusercontent.com/u/13360138?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ajax M</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=ajaxm" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://dylnuge.com"><img src="https://avatars2.githubusercontent.com/u/118624?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dylan Nugent</b></sub></a><br /><a href="#content-Dylnuge" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/vyaslav"><img src="https://avatars0.githubusercontent.com/u/1385427?v=4?s=100" width="100px;" alt=""/><br /><sub><b>vyaslav</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=vyaslav" title="Code">💻</a> <a href="#content-vyaslav" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://join.sfxd.org"><img src="https://avatars1.githubusercontent.com/u/17297466?v=4?s=100" width="100px;" alt=""/><br /><sub><b>George</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=gdoenlen" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/nyxtom"><img src="https://avatars2.githubusercontent.com/u/222763?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Thomas Holloway</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=nyxtom" title="Code">💻</a> <a href="#content-nyxtom" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/workingjubilee"><img src="https://avatars1.githubusercontent.com/u/46493976?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jubilee</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=workingjubilee" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/WofWca"><img src="https://avatars1.githubusercontent.com/u/39462442?v=4?s=100" width="100px;" alt=""/><br /><sub><b>WofWca</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=WofWca" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/jrvidal"><img src="https://avatars0.githubusercontent.com/u/1636604?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Roberto Vidal</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=jrvidal" title="Code">💻</a> <a href="https://github.com/rust-lang/rustlings/commits?author=jrvidal" title="Documentation">📖</a> <a href="#ideas-jrvidal" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-jrvidal" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://github.com/jensim"><img src="https://avatars0.githubusercontent.com/u/3663856?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jens</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=jensim" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="http://rahatah.me/d"><img src="https://avatars3.githubusercontent.com/u/3174006?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rahat Ahmed</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=rahatarmanahmed" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/AbdouSeck"><img src="https://avatars2.githubusercontent.com/u/6490055?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Abdou Seck</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=AbdouSeck" title="Code">💻</a> <a href="#content-AbdouSeck" title="Content">🖋</a> <a href="https://github.com/rust-lang/rustlings/pulls?q=is%3Apr+reviewed-by%3AAbdouSeck" title="Reviewed Pull Requests">👀</a></td>
|
||||
<td align="center"><a href="https://codehearts.com"><img src="https://avatars0.githubusercontent.com/u/2885412?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Katie</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=codehearts" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/Socratides"><img src="https://avatars3.githubusercontent.com/u/27732983?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Socrates</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Socratides" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/gnodarse"><img src="https://avatars3.githubusercontent.com/u/46761795?v=4?s=100" width="100px;" alt=""/><br /><sub><b>gnodarse</b></sub></a><br /><a href="#content-gnodarse" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/harrisonmetz"><img src="https://avatars1.githubusercontent.com/u/7883408?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Harrison Metzger</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=harrisonmetz" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/TorbenJ"><img src="https://avatars2.githubusercontent.com/u/9077102?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Torben Jonas</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=TorbenJ" title="Code">💻</a> <a href="#content-TorbenJ" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://paulbissex.com/"><img src="https://avatars0.githubusercontent.com/u/641?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul Bissex</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=pbx" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/sjmann"><img src="https://avatars0.githubusercontent.com/u/6589896?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steven Mann</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=sjmann" title="Code">💻</a> <a href="#content-sjmann" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://smmdb.net/"><img src="https://avatars2.githubusercontent.com/u/5855071?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mario Reder</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Tarnadas" title="Code">💻</a> <a href="#content-Tarnadas" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://keybase.io/skim"><img src="https://avatars0.githubusercontent.com/u/47347?v=4?s=100" width="100px;" alt=""/><br /><sub><b>skim</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=sl4m" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/sanjaykdragon"><img src="https://avatars1.githubusercontent.com/u/10261698?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sanjay K</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=sanjaykdragon" title="Code">💻</a> <a href="#content-sanjaykdragon" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://www.rohanjain.in"><img src="https://avatars1.githubusercontent.com/u/343499?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rohan Jain</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=crodjer" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://www.saidaspen.se"><img src="https://avatars1.githubusercontent.com/u/7727687?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Said Aspen</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=saidaspen" title="Code">💻</a> <a href="#content-saidaspen" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/uce"><img src="https://avatars3.githubusercontent.com/u/1756620?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ufuk Celebi</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=uce" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/lebedevsergey"><img src="https://avatars2.githubusercontent.com/u/7325764?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lebedevsergey</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=lebedevsergey" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/avrong"><img src="https://avatars2.githubusercontent.com/u/6342851?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aleksei Trifonov</b></sub></a><br /><a href="#content-avrong" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://drn.ie"><img src="https://avatars2.githubusercontent.com/u/411136?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Darren Meehan</b></sub></a><br /><a href="#content-Darrenmeehan" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/jihchi"><img src="https://avatars1.githubusercontent.com/u/87983?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jihchi Lee</b></sub></a><br /><a href="#content-jihchi" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/bertonha"><img src="https://avatars3.githubusercontent.com/u/1225902?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Christofer Bertonha</b></sub></a><br /><a href="#content-bertonha" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/apatniv"><img src="https://avatars2.githubusercontent.com/u/22565917?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vivek Bharath Akupatni</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=apatniv" title="Code">💻</a> <a href="https://github.com/rust-lang/rustlings/commits?author=apatniv" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/DiD92"><img src="https://avatars3.githubusercontent.com/u/6002416?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dídac Sementé Fernández</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=DiD92" title="Code">💻</a> <a href="#content-DiD92" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/wrobstory"><img src="https://avatars3.githubusercontent.com/u/2601457?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rob Story</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=wrobstory" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/siobhanjacobson"><img src="https://avatars2.githubusercontent.com/u/28983835?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Siobhan Jacobson</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=siobhanjacobson" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://www.linkedin.com/in/evancarroll/"><img src="https://avatars2.githubusercontent.com/u/19922?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Evan Carroll</b></sub></a><br /><a href="#content-EvanCarroll" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://www.jawaadmahmood.com"><img src="https://avatars3.githubusercontent.com/u/95606?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jawaad Mahmood</b></sub></a><br /><a href="#content-jmahmood" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/GaurangTandon"><img src="https://avatars1.githubusercontent.com/u/6308683?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gaurang Tandon</b></sub></a><br /><a href="#content-GaurangTandon" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/dev-cyprium"><img src="https://avatars1.githubusercontent.com/u/6002628?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stefan Kupresak</b></sub></a><br /><a href="#content-dev-cyprium" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/greg-el"><img src="https://avatars3.githubusercontent.com/u/45019882?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Greg Leonard</b></sub></a><br /><a href="#content-greg-el" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://ryanpcmcquen.org"><img src="https://avatars3.githubusercontent.com/u/772937?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ryan McQuen</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=ryanpcmcquen" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/AnnikaCodes"><img src="https://avatars3.githubusercontent.com/u/56906084?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Annika</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/pulls?q=is%3Apr+reviewed-by%3AAnnikaCodes" title="Reviewed Pull Requests">👀</a></td>
|
||||
<td align="center"><a href="https://darnuria.eu"><img src="https://avatars1.githubusercontent.com/u/2827553?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Axel Viala</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=darnuria" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://sazid.github.io"><img src="https://avatars1.githubusercontent.com/u/2370167?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mohammed Sazid Al Rashid</b></sub></a><br /><a href="#content-sazid" title="Content">🖋</a> <a href="https://github.com/rust-lang/rustlings/commits?author=sazid" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://codingthemsoftly.com"><img src="https://avatars1.githubusercontent.com/u/17479099?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Caleb Webber</b></sub></a><br /><a href="#maintenance-seeplusplus" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://github.com/pcn"><img src="https://avatars2.githubusercontent.com/u/1056756?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Peter N</b></sub></a><br /><a href="#maintenance-pcn" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://github.com/seancad"><img src="https://avatars1.githubusercontent.com/u/47405611?v=4?s=100" width="100px;" alt=""/><br /><sub><b>seancad</b></sub></a><br /><a href="#maintenance-seancad" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="http://willhayworth.com"><img src="https://avatars3.githubusercontent.com/u/181174?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Will Hayworth</b></sub></a><br /><a href="#content-wsh" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/chrizel"><img src="https://avatars3.githubusercontent.com/u/20802?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Christian Zeller</b></sub></a><br /><a href="#content-chrizel" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/jfchevrette"><img src="https://avatars.githubusercontent.com/u/3001?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jean-Francois Chevrette</b></sub></a><br /><a href="#content-jfchevrette" title="Content">🖋</a> <a href="https://github.com/rust-lang/rustlings/commits?author=jfchevrette" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/jbaber"><img src="https://avatars.githubusercontent.com/u/1908117?v=4?s=100" width="100px;" alt=""/><br /><sub><b>John Baber-Lucero</b></sub></a><br /><a href="#content-jbaber" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/tal-zvon"><img src="https://avatars.githubusercontent.com/u/3195851?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tal</b></sub></a><br /><a href="#content-tal-zvon" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/apogeeoak"><img src="https://avatars.githubusercontent.com/u/59737221?v=4?s=100" width="100px;" alt=""/><br /><sub><b>apogeeoak</b></sub></a><br /><a href="#content-apogeeoak" title="Content">🖋</a> <a href="https://github.com/rust-lang/rustlings/commits?author=apogeeoak" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://www.garfieldtech.com/"><img src="https://avatars.githubusercontent.com/u/254863?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Larry Garfield</b></sub></a><br /><a href="#content-Crell" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/circumspect"><img src="https://avatars.githubusercontent.com/u/40770208?v=4?s=100" width="100px;" alt=""/><br /><sub><b>circumspect</b></sub></a><br /><a href="#content-circumspect" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/cjwyett"><img src="https://avatars.githubusercontent.com/u/34195737?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cyrus Wyett</b></sub></a><br /><a href="#content-cjwyett" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/cadolphs"><img src="https://avatars.githubusercontent.com/u/13894820?v=4?s=100" width="100px;" alt=""/><br /><sub><b>cadolphs</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=cadolphs" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://www.haveneer.com"><img src="https://avatars.githubusercontent.com/u/26146722?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pascal H.</b></sub></a><br /><a href="#content-hpwxf" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://twitter.com/chapeupreto"><img src="https://avatars.githubusercontent.com/u/834048?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rod Elias</b></sub></a><br /><a href="#content-chapeupreto" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/blerchy"><img src="https://avatars.githubusercontent.com/u/2555355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matt Lebl</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=blerchy" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://flakolefluk.dev"><img src="https://avatars.githubusercontent.com/u/11986564?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ignacio Le Fluk</b></sub></a><br /><a href="#content-flakolefluk" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/tlyu"><img src="https://avatars.githubusercontent.com/u/431873?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Taylor Yu</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=tlyu" title="Code">💻</a> <a href="#content-tlyu" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://zerotask.github.io"><img src="https://avatars.githubusercontent.com/u/20150243?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Patrick Hintermayer</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Zerotask" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://petkopavlovski.com/"><img src="https://avatars.githubusercontent.com/u/32264020?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pete Pavlovski</b></sub></a><br /><a href="#content-arthas168" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/k12ish"><img src="https://avatars.githubusercontent.com/u/45272873?v=4?s=100" width="100px;" alt=""/><br /><sub><b>k12ish</b></sub></a><br /><a href="#content-k12ish" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/hongshaoyang"><img src="https://avatars.githubusercontent.com/u/19281800?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shao Yang Hong</b></sub></a><br /><a href="#content-hongshaoyang" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/bmacer"><img src="https://avatars.githubusercontent.com/u/13931806?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Brandon Macer</b></sub></a><br /><a href="#content-bmacer" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/stoiandan"><img src="https://avatars.githubusercontent.com/u/10388612?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stoian Dan</b></sub></a><br /><a href="#content-stoiandan" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://about.me/pjdelport"><img src="https://avatars.githubusercontent.com/u/630271?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pi Delport</b></sub></a><br /><a href="#content-PiDelport" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/sateeshkumarb"><img src="https://avatars.githubusercontent.com/u/429263?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sateesh </b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=sateeshkumarb" title="Code">💻</a> <a href="#content-sateeshkumarb" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/kayuapi"><img src="https://avatars.githubusercontent.com/u/10304328?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ZC</b></sub></a><br /><a href="#content-kayuapi" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/hyperparabolic"><img src="https://avatars.githubusercontent.com/u/12348474?v=4?s=100" width="100px;" alt=""/><br /><sub><b>hyperparabolic</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=hyperparabolic" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://www.net4visions.at"><img src="https://avatars.githubusercontent.com/u/5228369?v=4?s=100" width="100px;" alt=""/><br /><sub><b>arlecchino</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=kolbma" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://richthofen.io/"><img src="https://avatars.githubusercontent.com/u/7576730?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Richthofen</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=jazzplato" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/cseltol"><img src="https://avatars.githubusercontent.com/u/64264529?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ivan Nerazumov</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=cseltol" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/lauralindzey"><img src="https://avatars.githubusercontent.com/u/65185744?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lauralindzey</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=lauralindzey" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/sinharaksh1t"><img src="https://avatars.githubusercontent.com/u/28585848?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rakshit Sinha</b></sub></a><br /><a href="#content-sinharaksh1t" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/dbednar230"><img src="https://avatars.githubusercontent.com/u/54457902?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Damian</b></sub></a><br /><a href="#content-dbednar230" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://benarmstead.co.uk"><img src="https://avatars.githubusercontent.com/u/70973680?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ben Armstead</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=benarmstead" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/anuk909"><img src="https://avatars.githubusercontent.com/u/34924662?v=4?s=100" width="100px;" alt=""/><br /><sub><b>anuk909</b></sub></a><br /><a href="#content-anuk909" title="Content">🖋</a> <a href="https://github.com/rust-lang/rustlings/commits?author=anuk909" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://granddaifuku.com/"><img src="https://avatars.githubusercontent.com/u/49578068?v=4?s=100" width="100px;" alt=""/><br /><sub><b>granddaifuku</b></sub></a><br /><a href="#content-granddaifuku" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://weilet.me"><img src="https://avatars.githubusercontent.com/u/32561597?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Weilet</b></sub></a><br /><a href="#content-Weilet" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/Millione"><img src="https://avatars.githubusercontent.com/u/38575932?v=4?s=100" width="100px;" alt=""/><br /><sub><b>LIU JIE</b></sub></a><br /><a href="#content-Millione" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/abusch"><img src="https://avatars.githubusercontent.com/u/506344?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Antoine Büsch</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=abusch" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://frogtd.com/"><img src="https://avatars.githubusercontent.com/u/31412003?v=4?s=100" width="100px;" alt=""/><br /><sub><b>frogtd</b></sub></a><br /><a href="#content-frogtd" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/EmisonLu"><img src="https://avatars.githubusercontent.com/u/54395432?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zhenghao Lu</b></sub></a><br /><a href="#content-EmisonLu" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://soundtrackyourbrand.com"><img src="https://avatars.githubusercontent.com/u/762956?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fredrik Enestad</b></sub></a><br /><a href="#content-fredr" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://xuesong.pydevops.com"><img src="https://avatars.githubusercontent.com/u/18476085?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xuesong</b></sub></a><br /><a href="#content-xuesongbj" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/MpdWalsh"><img src="https://avatars.githubusercontent.com/u/48160144?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Michael Walsh</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=MpdWalsh" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/alirezaghey"><img src="https://avatars.githubusercontent.com/u/26653424?v=4?s=100" width="100px;" alt=""/><br /><sub><b>alirezaghey</b></sub></a><br /><a href="#content-alirezaghey" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/frvannes16"><img src="https://avatars.githubusercontent.com/u/3188475?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Franklin van Nes</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=frvannes16" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://nekonako.github.io"><img src="https://avatars.githubusercontent.com/u/46141275?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nekonako</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=nekonako" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/tan-zx"><img src="https://avatars.githubusercontent.com/u/67887489?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ZX</b></sub></a><br /><a href="#content-tan-zx" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/sundevilyang"><img src="https://avatars.githubusercontent.com/u/1499214?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yang Wen</b></sub></a><br /><a href="#content-sundevilyang" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://brandon-high.com"><img src="https://avatars.githubusercontent.com/u/759848?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Brandon High</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=highb" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/x-hgg-x"><img src="https://avatars.githubusercontent.com/u/39058530?v=4?s=100" width="100px;" alt=""/><br /><sub><b>x-hgg-x</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=x-hgg-x" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://kisaragieffective.github.io"><img src="https://avatars.githubusercontent.com/u/48310258?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kisaragi</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=KisaragiEffective" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Kallu-A"><img src="https://avatars.githubusercontent.com/u/73198738?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lucas Aries</b></sub></a><br /><a href="#content-Kallu-A" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/ragreenburg"><img src="https://avatars.githubusercontent.com/u/24358100?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ragreenburg</b></sub></a><br /><a href="#content-ragreenburg" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/stevenfukase"><img src="https://avatars.githubusercontent.com/u/66785624?v=4?s=100" width="100px;" alt=""/><br /><sub><b>stevenfukase</b></sub></a><br /><a href="#content-stevenfukase" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/J-S-Kim"><img src="https://avatars.githubusercontent.com/u/17569303?v=4?s=100" width="100px;" alt=""/><br /><sub><b>J-S-Kim</b></sub></a><br /><a href="#content-J-S-Kim" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/Fointard"><img src="https://avatars.githubusercontent.com/u/9333398?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fointard</b></sub></a><br /><a href="#content-Fointard" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
||||
182
CHANGELOG.md
182
CHANGELOG.md
@@ -1,3 +1,185 @@
|
||||
<a name="4.7.1"></a>
|
||||
## 4.7.1 (2022-04-20)
|
||||
|
||||
#### Features
|
||||
|
||||
- The amount of dependency crates that need to be compiled went down from ~65 to
|
||||
~45 by bumping dependency versions.
|
||||
- The minimum Rust version in the install scripts has been bumped to 1.56.0 (this isn't in
|
||||
the release itself, since install scripts don't really get versioned)
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
- **arc1**: A small part has been rewritten using a more functional code style (#968).
|
||||
- **using_as**: A small part has been refactored to use `sum` instead of `fold`, resulting
|
||||
in better readability.
|
||||
|
||||
#### Housekeeping
|
||||
|
||||
- The changelog will now be manually written instead of being automatically generated by the
|
||||
Git log.
|
||||
|
||||
<a name="4.7.0"></a>
|
||||
## 4.7.0 (2022-04-14)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* Add move_semantics6.rs exercise (#908) ([3f0e1303](https://github.com/rust-lang/rustlings/commit/3f0e1303e0b3bf3fecc0baced3c8b8a37f83c184))
|
||||
* **intro:** Add intro section. ([21c9f441](https://github.com/rust-lang/rustlings/commit/21c9f44168394e08338fd470b5f49b1fd235986f))
|
||||
* Include exercises folder in the project structure behind a feature, enabling rust-analyzer to work (#917) ([179a75a6](https://github.com/rust-lang/rustlings/commit/179a75a68d03ac9518dec2297fb17f91a4fc506b))
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Fix a few spelling mistakes ([1c0fe3cb](https://github.com/rust-lang/rustlings/commit/1c0fe3cbcca85f90b3985985b8e265ee872a2ab2))
|
||||
* **cli:**
|
||||
* Move long text strings into constants. ([f78c4802](https://github.com/rust-lang/rustlings/commit/f78c48020830d7900dd8d81f355606581670446d))
|
||||
* Replace `filter_map()` with `find_map()` ([9b27e8d](https://github.com/rust-lang/rustlings/commit/9b27e8d993ca20232fe38a412750c3f845a83b65))
|
||||
* **clippy1:**
|
||||
* Set clippy::float_cmp lint to deny (#907) ([71a06044](https://github.com/rust-lang/rustlings/commit/71a06044e6a96ff756dc31d7b0ed665ae4badb57))
|
||||
* Updated code to test correctness clippy lint with approx_constant lint rule ([f2650de3](https://github.com/rust-lang/rustlings/commit/f2650de369810867d2763e935ac0963c32ec420e))
|
||||
* **errors1:**
|
||||
* Add a comment to make the purpose more clear (#486) ([cbcde345](https://github.com/rust-lang/rustlings/commit/cbcde345409c3e550112e449242848eaa3391bb6))
|
||||
* Don't modify tests (#958) ([60bb7cc](https://github.com/rust-lang/rustlings/commit/60bb7cc3931d21d3986ad52b2b302e632a93831c))
|
||||
* **errors6:** Remove existing answer code ([43d0623](https://github.com/rust-lang/rustlings/commit/43d0623086edbc46fe896ba59c7afa22c3da9f7a))
|
||||
* **functions5:** Remove wrong new line and small English improvements (#885) ([8ef4869b](https://github.com/rust-lang/rustlings/commit/8ef4869b264094e5a9b50452b4534823a9df19c3))
|
||||
* **install:** protect path with whitespaces using quotes and stop at the first error ([d114847f](https://github.com/rust-lang/rustlings/commit/d114847f256c5f571c0b4c87e04b04bce3435509))
|
||||
* **intro1:** Add compiler error explanation. ([9b8de655](https://github.com/rust-lang/rustlings/commit/9b8de65525a5576b78cf0c8e4098cdd34296338f))
|
||||
* **iterators1:** reorder TODO steps ([0bd7a063](https://github.com/rust-lang/rustlings/commit/0bd7a0631a17a9d69af5746795a30efc9cf64e6e))
|
||||
* **move_semantics2:** Add comment ([89650f80](https://github.com/rust-lang/rustlings/commit/89650f808af23a32c9a2c6d46592b77547a6a464))
|
||||
* **move_semantics5:** correct typo (#857) ([46c28d5c](https://github.com/rust-lang/rustlings/commit/46c28d5cef3d8446b5a356b19d8dbc725f91a3a0))
|
||||
* **quiz1:** update to say quiz covers "If" ([1622e8c1](https://github.com/rust-lang/rustlings/commit/1622e8c198d89739765c915203efff0091bdeb78))
|
||||
* **structs3:**
|
||||
* Add a hint for panic (#608) ([4f7ff5d9](https://github.com/rust-lang/rustlings/commit/4f7ff5d9c7b2d8b045194c1a9469d37e30257c4a))
|
||||
* remove redundant 'return' (#852) ([bf33829d](https://github.com/rust-lang/rustlings/commit/bf33829da240375d086f96267fc2e02fa6b07001))
|
||||
* Assigned value to `cents_per_gram` in test ([d1ee2da](https://github.com/rust-lang/rustlings/commit/d1ee2daf14f19105e6db3f9c610f44293d688532))
|
||||
* **structs3.rs:** assigned value to cents_per_gram in test ([d1ee2daf](https://github.com/rust-lang/rustlings/commit/d1ee2daf14f19105e6db3f9c610f44293d688532))
|
||||
* **traits1:** rename test functions to snake case (#854) ([1663a16e](https://github.com/rust-lang/rustlings/commit/1663a16eade6ca646b6ed061735f7982434d530d))
|
||||
|
||||
#### Documentation improvements
|
||||
|
||||
* Add hints on how to get GCC installed (#741) ([bc56861](https://github.com/rust-lang/rustlings/commit/bc5686174463ad6f4f6b824b0e9b97c3039d4886))
|
||||
* Fix some code blocks that were not highlighted ([17f9d74](https://github.com/rust-lang/rustlings/commit/17f9d7429ccd133a72e815fb5618e0ce79560929))
|
||||
|
||||
|
||||
<a name="4.6.0"></a>
|
||||
## 4.6.0 (2021-09-25)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* add advanced_errs2 ([abd6b70c](https://github.com/rust-lang/rustlings/commit/abd6b70c72dc6426752ff41f09160b839e5c449e))
|
||||
* add advanced_errs1 ([882d535b](https://github.com/rust-lang/rustlings/commit/882d535ba8628d5e0b37e8664b3e2f26260b2671))
|
||||
* Add a farewell message when quitting `watch` ([1caef0b4](https://github.com/rust-lang/rustlings/commit/1caef0b43494c8b8cdd6c9260147e70d510f1aca))
|
||||
* add more watch commands ([a7dc080b](https://github.com/rust-lang/rustlings/commit/a7dc080b95e49146fbaafe6922a6de2f8cb1582a), closes [#842](https://github.com/rust-lang/rustlings/issues/842))
|
||||
* **modules:** update exercises, add modules3 (#822) ([dfd2fab4](https://github.com/rust-lang/rustlings/commit/dfd2fab4f33d1bf59e2e5ee03123c0c9a67a9481))
|
||||
* **quiz1:** add default function name in comment (#838) ([0a11bad7](https://github.com/rust-lang/rustlings/commit/0a11bad71402b5403143d642f439f57931278c07))
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Correct small typo in exercises/conversions/from_str.rs ([86cc8529](https://github.com/rust-lang/rustlings/commit/86cc85295ae36948963ae52882e285d7e3e29323))
|
||||
* **cli:** typo in exercise.rs (#848) ([06d5c097](https://github.com/rust-lang/rustlings/commit/06d5c0973a3dffa3c6c6f70acb775d4c6630323c))
|
||||
* **from_str, try_from_into:** custom error types ([2dc93cad](https://github.com/rust-lang/rustlings/commit/2dc93caddad43821743e4903d89b355df58d7a49))
|
||||
* **modules2:** fix typo (#835) ([1c3beb0a](https://github.com/rust-lang/rustlings/commit/1c3beb0a59178c950dc05fe8ee2346b017429ae0))
|
||||
* **move_semantics5:**
|
||||
* change &mut *y to &mut x (#814) ([d75759e8](https://github.com/rust-lang/rustlings/commit/d75759e829fdcd64ef071cf4b6eae2a011a7718b))
|
||||
* Clarify instructions ([df25684c](https://github.com/rust-lang/rustlings/commit/df25684cb79f8413915e00b5efef29369849cef1))
|
||||
* **quiz1:** Fix inconsistent wording (#826) ([03131a3d](https://github.com/rust-lang/rustlings/commit/03131a3d35d9842598150f9da817f7cc26e2669a))
|
||||
|
||||
|
||||
|
||||
<a name="4.5.0"></a>
|
||||
## 4.5.0 (2021-07-07)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* Add move_semantics5 exercise. (#746) ([399ab328](https://github.com/rust-lang/rustlings/commit/399ab328d8d407265c09563aa4ef4534b2503ff2))
|
||||
* **cli:** Add "next" to run the next unsolved exercise. (#785) ([d20e413a](https://github.com/rust-lang/rustlings/commit/d20e413a68772cd493561f2651cf244e822b7ca5))
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* rename result1 to errors4 ([50ab289d](https://github.com/rust-lang/rustlings/commit/50ab289da6b9eb19a7486c341b00048c516b88c0))
|
||||
* move_semantics5 hints ([1b858285](https://github.com/rust-lang/rustlings/commit/1b85828548f46f58b622b5e0c00f8c989f928807))
|
||||
* remove trailing whitespaces from iterators1 ([4d4fa774](https://github.com/rust-lang/rustlings/commit/4d4fa77459392acd3581c6068aa8be9a02de12fc))
|
||||
* add hints to generics1 and generics2 exercises ([31457940](https://github.com/rust-lang/rustlings/commit/31457940846b3844d78d4a4d2b074bc8d6aaf1eb))
|
||||
* remove trailing whitespace ([d9b69bd1](https://github.com/rust-lang/rustlings/commit/d9b69bd1a0a7a99f2c0d80933ad2eea44c8c71b2))
|
||||
* **installation:** first PowerShell command ([aa9a943d](https://github.com/rust-lang/rustlings/commit/aa9a943ddf3ae260782e73c26bcc9db60e5894b6))
|
||||
* **iterators5:** derive Clone, Copy ([91fc9e31](https://github.com/rust-lang/rustlings/commit/91fc9e3118f4af603c9911698cc2a234725cb032))
|
||||
* **quiz1:** Updated question description (#794) ([d8766496](https://github.com/rust-lang/rustlings/commit/d876649616cc8a8dd5f539f8bc1a5434b960b1e9))
|
||||
* **try_from_into, from_str:** hints for dyn Error ([11d2cf0d](https://github.com/rust-lang/rustlings/commit/11d2cf0d604dee3f5023c17802d69438e69fa50e))
|
||||
* **variables5:** confine the answer further ([48ffcbd2](https://github.com/rust-lang/rustlings/commit/48ffcbd2c4cc4d936c2c7480019190f179813cc5))
|
||||
|
||||
|
||||
|
||||
<a name="4.4.0"></a>
|
||||
## 4.4.0 (2021-04-24)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Fix spelling error in main.rs ([91ee27f2](https://github.com/rust-lang/rustlings/commit/91ee27f22bd3797a9db57e5fd430801c170c5db8))
|
||||
* typo in default out text ([644c49f1](https://github.com/rust-lang/rustlings/commit/644c49f1e04cbb24e95872b3a52b07d692ae3bc8))
|
||||
* **collections:** Naming exercises for vectors and hashmap ([bef39b12](https://github.com/rust-lang/rustlings/commit/bef39b125961310b34b34871e480a82e82af4678))
|
||||
* **from_str:**
|
||||
* Correct typos ([5f7c89f8](https://github.com/rust-lang/rustlings/commit/5f7c89f85db1f33da01911eaa479c3a2d4721678))
|
||||
* test for error instead of unwrap/should_panic ([15e71535](https://github.com/rust-lang/rustlings/commit/15e71535f37cfaed36e22eb778728d186e2104ab))
|
||||
* use trait objects for from_str ([c3e7b831](https://github.com/rust-lang/rustlings/commit/c3e7b831786c9172ed8bd5d150f3c432f242fba9))
|
||||
* **functions3:** improve function argument type (#687) ([a6509cc4](https://github.com/rust-lang/rustlings/commit/a6509cc4d545d8825f01ddf7ee37823b372154dd))
|
||||
* **hashmap2:** Update incorrect assertion (#660) ([72aaa15e](https://github.com/rust-lang/rustlings/commit/72aaa15e6ab4b72b3422f1c6356396e20a2a2bb8))
|
||||
* **info:** Fix typo (#635) ([cddc1e86](https://github.com/rust-lang/rustlings/commit/cddc1e86e7ec744ee644cc774a4887b1a0ded3e8))
|
||||
* **iterators2:** Moved errors out of tests. ([baf4ba17](https://github.com/rust-lang/rustlings/commit/baf4ba175ba6eb92989e3dd54ecbec4bedc9a863), closes [#359](https://github.com/rust-lang/rustlings/issues/359))
|
||||
* **iterators3:** Enabled iterators3.rs to run without commented out tests. ([c6712dfc](https://github.com/rust-lang/rustlings/commit/c6712dfccd1a093e590ad22bbc4f49edc417dac0))
|
||||
* **main:** Let find_exercise work with borrows ([347f30bd](https://github.com/rust-lang/rustlings/commit/347f30bd867343c5ace1097e085a1f7e356553f7))
|
||||
* **move_semantics4:**
|
||||
* Remove redundant "instead" (#640) ([cc266d7d](https://github.com/rust-lang/rustlings/commit/cc266d7d80b91e79df3f61984f231b7f1587218e))
|
||||
* Small readbility improvement (#617) ([10965920](https://github.com/rust-lang/rustlings/commit/10965920fbdf8a1efc85bed869e55a1787006404))
|
||||
* **option2:** Rename uninformative variables (#675) ([b4de6594](https://github.com/rust-lang/rustlings/commit/b4de6594380636817d13c2677ec6f472a964cf43))
|
||||
* **quiz3:** Force an answer to Q2 (#672) ([0d894e6f](https://github.com/rust-lang/rustlings/commit/0d894e6ff739943901e1ae8c904582e5c2f843bd))
|
||||
* **structs:** Add 5.3 to structs/README (#652) ([6bd791f2](https://github.com/rust-lang/rustlings/commit/6bd791f2f44aa7f0ad926df767f6b1fa8f12a9a9))
|
||||
* **structs2:** correct grammar in hint (#663) ([ebdb66c7](https://github.com/rust-lang/rustlings/commit/ebdb66c7bfb6d687a14cc511a559a222e6fc5de4))
|
||||
* **structs3:**
|
||||
* reword heading comment (#664) ([9f3e8c2d](https://github.com/rust-lang/rustlings/commit/9f3e8c2dde645e5264c2d2200e68842b5f47bfa3))
|
||||
* add check to prevent naive implementation of is_international ([05a753fe](https://github.com/rust-lang/rustlings/commit/05a753fe6333d36dbee5f68c21dec04eacdc75df))
|
||||
* **threads1:** line number correction ([7857b0a6](https://github.com/rust-lang/rustlings/commit/7857b0a689b0847f48d8c14cbd1865e3b812d5ca))
|
||||
* **try_from_into:** use trait objects ([2e93a588](https://github.com/rust-lang/rustlings/commit/2e93a588e0abe8badb7eafafb9e7d073c2be5df8))
|
||||
|
||||
#### Features
|
||||
|
||||
* Replace clap with argh ([7928122f](https://github.com/rust-lang/rustlings/commit/7928122fcef9ca7834d988b1ec8ca0687478beeb))
|
||||
* Replace emojis when NO_EMOJI env variable present ([8d62a996](https://github.com/rust-lang/rustlings/commit/8d62a9963708dbecd9312e8bcc4b47049c72d155))
|
||||
* Added iterators5.rs exercise. ([b29ea17e](https://github.com/rust-lang/rustlings/commit/b29ea17ea94d1862114af2cf5ced0e09c197dc35))
|
||||
* **arc1:** Add more details to description and hint (#710) ([81be4044](https://github.com/rust-lang/rustlings/commit/81be40448777fa338ebced3b0bfc1b32d6370313))
|
||||
* **cli:** Improve the list command with options, and then some ([8bbe4ff1](https://github.com/rust-lang/rustlings/commit/8bbe4ff1385c5c169c90cd3ff9253f9a91daaf8e))
|
||||
* **list:**
|
||||
* updated progress percentage ([1c6f7e4b](https://github.com/rust-lang/rustlings/commit/1c6f7e4b7b9b3bd36f4da2bb2b69c549cc8bd913))
|
||||
* added progress info ([c0e3daac](https://github.com/rust-lang/rustlings/commit/c0e3daacaf6850811df5bc57fa43e0f249d5cfa4))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.0"></a>
|
||||
## 4.3.0 (2020-12-29)
|
||||
|
||||
#### Features
|
||||
|
||||
* Rewrite default out text ([44d39112](https://github.com/rust-lang/rustlings/commit/44d39112ff122b29c9793fe52e605df1612c6490))
|
||||
* match exercise order to book chapters (#541) ([033bf119](https://github.com/rust-lang/rustlings/commit/033bf1198fc8bfce1b570e49da7cde010aa552e3))
|
||||
* Crab? (#586) ([fa9f522b](https://github.com/rust-lang/rustlings/commit/fa9f522b7f043d7ef73a39f003a9272dfe72c4f4))
|
||||
* add "rustlings list" command ([838f9f30](https://github.com/rust-lang/rustlings/commit/838f9f30083d0b23fd67503dcf0fbeca498e6647))
|
||||
* **try_from_into:** remove duplicate annotation ([04f1d079](https://github.com/rust-lang/rustlings/commit/04f1d079aa42a2f49af694bc92c67d731d31a53f))
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* update structs README ([bcf14cf6](https://github.com/rust-lang/rustlings/commit/bcf14cf677adb3a38a3ac3ca53f3c69f61153025))
|
||||
* added missing exercises to info.toml ([90cfb6ff](https://github.com/rust-lang/rustlings/commit/90cfb6ff28377531bfc34acb70547bdb13374f6b))
|
||||
* gives a bit more context to magic number ([30644c9a](https://github.com/rust-lang/rustlings/commit/30644c9a062b825c0ea89435dc59f0cad86b110e))
|
||||
* **functions2:** Change signature to trigger precise error message: (#605) ([0ef95947](https://github.com/rust-lang/rustlings/commit/0ef95947cc30482e63a7045be6cc2fb6f6dcb4cc))
|
||||
* **structs1:** Adjust wording (#573) ([9334783d](https://github.com/rust-lang/rustlings/commit/9334783da31d821cc59174fbe8320df95828926c))
|
||||
* **try_from_into:**
|
||||
* type error ([4f4cfcf3](https://github.com/rust-lang/rustlings/commit/4f4cfcf3c36c8718c7c170c9c3a6935e6ef0618c))
|
||||
* Update description (#584) ([96347df9](https://github.com/rust-lang/rustlings/commit/96347df9df294f01153b29d9ad4ba361f665c755))
|
||||
* **vec1:** Have test compare every element in a and v ([9b6c6293](https://github.com/rust-lang/rustlings/commit/9b6c629397b24b944f484f5b2bbd8144266b5695))
|
||||
|
||||
<a name="4.2.0"></a>
|
||||
## 4.2.0 (2020-11-07)
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ isn't really that complicated since the bulk of the work is done by `rustc`.
|
||||
<a name="addex"></a>
|
||||
### Adding an exercise
|
||||
|
||||
First step is to add the exercise! Call it `exercises/yourTopic/yourTopicN.rs`, make sure to
|
||||
The first step is to add the exercise! Name the file `exercises/yourTopic/yourTopicN.rs`, make sure to
|
||||
put in some helpful links, and link to sections of the book in `exercises/yourTopic/README.md`.
|
||||
|
||||
Next you want to make sure it runs when using `rustlings`. All exercises are stored in `info.toml`, under the `exercises` array. They're ordered by the order they're ran when using `rustlings verify`.
|
||||
Next make sure it runs with `rustlings`. The exercise metadata is stored in `info.toml`, under the `exercises` array. The order of the `exercises` array determines the order the exercises are run by `rustlings verify`.
|
||||
|
||||
You want to make sure where in the file you add your exercise. If you're not sure, add it at the bottom and ask in your pull request. To add an exercise, edit the file like this:
|
||||
Add the metadata for your exercise in the correct order in the `exercises` array. If you are unsure of the correct ordering, add it at the bottom and ask in your pull request. The exercise metadata should contain the following:
|
||||
```diff
|
||||
...
|
||||
+ [[exercises]]
|
||||
|
||||
829
Cargo.lock
generated
829
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
23
Cargo.toml
23
Cargo.toml
@@ -1,17 +1,17 @@
|
||||
[package]
|
||||
name = "rustlings"
|
||||
version = "4.2.0"
|
||||
authors = ["Marisa <mokou@posteo.de>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
|
||||
edition = "2018"
|
||||
version = "4.7.1"
|
||||
authors = ["mokou <mokou@fastmail.com>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
clap = "2.32.0"
|
||||
indicatif = "0.10.3"
|
||||
console = "0.7.7"
|
||||
notify = "4.0.15"
|
||||
toml = "0.4.10"
|
||||
regex = "1.1.6"
|
||||
serde = {version = "1.0.10", features = ["derive"]}
|
||||
argh = "0.1"
|
||||
indicatif = "0.16"
|
||||
console = "0.15"
|
||||
notify = "4.0"
|
||||
toml = "0.5"
|
||||
regex = "1.5"
|
||||
serde= { version = "1.0", features = ["derive"] }
|
||||
|
||||
[[bin]]
|
||||
name = "rustlings"
|
||||
@@ -21,3 +21,6 @@ path = "src/main.rs"
|
||||
assert_cmd = "0.11.0"
|
||||
predicates = "1.0.1"
|
||||
glob = "0.3.0"
|
||||
|
||||
[features]
|
||||
exercises = []
|
||||
|
||||
187
README.md
187
README.md
@@ -1,9 +1,4 @@
|
||||

|
||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||
[](#contributors-)
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||
|
||||
# rustlings 🦀❤️ [](https://buildkite.com/mokou/rustlings)
|
||||
# rustlings 🦀❤️
|
||||
|
||||
Greetings and welcome to `rustlings`. This project contains small exercises to get you used to reading and writing Rust code. This includes reading and responding to compiler messages!
|
||||
|
||||
@@ -17,6 +12,7 @@ Alternatively, for a first-time Rust learner, there are several other resources:
|
||||
## Getting Started
|
||||
|
||||
_Note: If you're on MacOS, make sure you've installed Xcode and its developer tools by typing `xcode-select --install`._
|
||||
_Note: If you're on Linux, make sure you've installed gcc. Deb: `sudo apt install gcc`. Yum: `sudo yum -y install gcc`._
|
||||
|
||||
You will need to have Rust installed. You can get it by visiting https://rustup.rs. This'll also install Cargo, Rust's package/project manager.
|
||||
|
||||
@@ -25,29 +21,31 @@ You will need to have Rust installed. You can get it by visiting https://rustup.
|
||||
Just run:
|
||||
|
||||
```bash
|
||||
curl -L https://git.io/rustlings | bash
|
||||
curl -L https://git.io/install-rustlings | bash
|
||||
# Or if you want it to be installed to a different path:
|
||||
curl -L https://git.io/rustlings | bash -s mypath/
|
||||
curl -L https://git.io/install-rustlings | bash -s mypath/
|
||||
```
|
||||
|
||||
This will install Rustlings and give you access to the `rustlings` command. Run it to get started!
|
||||
|
||||
## Windows
|
||||
|
||||
In PowerShell, set `ExecutionPolicy` to `RemoteSigned`:
|
||||
In PowerShell (Run as Administrator), set `ExecutionPolicy` to `RemoteSigned`:
|
||||
|
||||
```ps
|
||||
Set-ExecutionPolicy RemoteSigned
|
||||
```ps1
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
||||
```
|
||||
|
||||
Then, you can run:
|
||||
|
||||
```ps
|
||||
Start-BitsTransfer -Source https://git.io/rustlings-win -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1
|
||||
```ps1
|
||||
Start-BitsTransfer -Source https://git.io/JTL5v -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1
|
||||
```
|
||||
|
||||
To install Rustlings. Same as on MacOS/Linux, you will have access to the `rustlings` command after it.
|
||||
|
||||
When you get a permission denied message then you have to exclude the directory where you placed the rustlings in your virus-scanner
|
||||
|
||||
## Browser:
|
||||
|
||||
[Run on Repl.it](https://repl.it/github/rust-lang/rustlings)
|
||||
@@ -56,16 +54,17 @@ To install Rustlings. Same as on MacOS/Linux, you will have access to the `rustl
|
||||
|
||||
## Manually
|
||||
|
||||
Basically: Clone the repository, checkout to the latest tag, run `cargo install`.
|
||||
Basically: Clone the repository at the latest tag, run `cargo install`.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/rust-lang/rustlings
|
||||
# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 4.6.0)
|
||||
git clone -b 4.6.0 --depth 1 https://github.com/rust-lang/rustlings
|
||||
cd rustlings
|
||||
git checkout tags/4.2.0 # or whatever the latest version is (find out at https://github.com/rust-lang/rustlings/releases/latest)
|
||||
cargo install --force --path .
|
||||
```
|
||||
|
||||
If there are installation errors, ensure that your toolchain is up to date. For the latest, run:
|
||||
|
||||
```bash
|
||||
rustup update
|
||||
```
|
||||
@@ -96,28 +95,78 @@ In case you want to go by your own order, or want to only verify a single exerci
|
||||
rustlings run myExercise1
|
||||
```
|
||||
|
||||
Or simply use the following command to run the next unsolved exercise in the course:
|
||||
|
||||
```bash
|
||||
rustlings run next
|
||||
```
|
||||
|
||||
In case you get stuck, you can run the following command to get a hint for your
|
||||
exercise:
|
||||
|
||||
``` bash
|
||||
```bash
|
||||
rustlings hint myExercise1
|
||||
```
|
||||
|
||||
You can also get the hint for the next unsolved exercise with the following command:
|
||||
|
||||
```bash
|
||||
rustlings hint next
|
||||
```
|
||||
|
||||
To check your progress, you can run the following command:
|
||||
|
||||
```bash
|
||||
rustlings list
|
||||
```
|
||||
|
||||
## Testing yourself
|
||||
|
||||
After every couple of sections, there will be a quiz that'll test your knowledge on a bunch of sections at once. These quizzes are found in `exercises/quizN.rs`.
|
||||
|
||||
## Enabling `rust-analyzer`
|
||||
|
||||
`rust-analyzer` support is provided, but it depends on your editor
|
||||
whether it's enabled by default. (RLS support is not provided)
|
||||
|
||||
To enable `rust-analyzer`, you'll need to make Cargo build the project
|
||||
with the `exercises` feature, which will automatically include the `exercises/`
|
||||
subfolder in the project. The easiest way to do this is to tell your editor to
|
||||
build the project with all features (the equivalent of `cargo build --all-features`).
|
||||
For specific editor instructions:
|
||||
|
||||
- **VSCode**: Add a `.vscode/settings.json` file with the following:
|
||||
```json
|
||||
{
|
||||
"rust-analyzer.cargo.features": ["exercises"]
|
||||
}
|
||||
```
|
||||
- **IntelliJ-based Editors**: Using the Rust plugin, everything should work
|
||||
by default.
|
||||
- _Missing your editor? Feel free to contribute more instructions!_
|
||||
|
||||
## Continuing On
|
||||
|
||||
Once you've completed Rustlings, put your new knowledge to good use! Continue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to.
|
||||
|
||||
If you'd like to uninstall Rustlings, you can do so by invoking cargo and removing the rustlings directory:
|
||||
## Uninstalling Rustlings
|
||||
|
||||
If you want to remove Rustlings from your system, there's two steps. First, you'll need to remove the exercises folder that the install script created
|
||||
for you:
|
||||
|
||||
```bash
|
||||
rm -rf rustlings # or your custom folder name, if you chose and or renamed it
|
||||
```
|
||||
|
||||
Second, since Rustlings got installed via `cargo install`, it's only reasonable to assume that you can also remove it using Cargo, and
|
||||
exactly that is the case. Run `cargo uninstall` to remove the `rustlings` binary:
|
||||
|
||||
```bash
|
||||
cargo uninstall rustlings
|
||||
rm -r rustlings/ # or on Windows: rmdir /s rustlings
|
||||
```
|
||||
|
||||
Now you should be done!
|
||||
|
||||
## Completion
|
||||
|
||||
Rustlings isn't done; there are a couple of sections that are very experimental and don't have proper documentation. These include:
|
||||
@@ -142,102 +191,4 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||
|
||||
## Contributors ✨
|
||||
|
||||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="http://carol-nichols.com"><img src="https://avatars2.githubusercontent.com/u/193874?v=4" width="100px;" alt=""/><br /><sub><b>Carol (Nichols || Goulding)</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=carols10cents" title="Code">💻</a> <a href="#content-carols10cents" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://twitter.com/QuietMisdreavus"><img src="https://avatars2.githubusercontent.com/u/5217170?v=4" width="100px;" alt=""/><br /><sub><b>QuietMisdreavus</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=QuietMisdreavus" title="Code">💻</a> <a href="#content-QuietMisdreavus" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/robertlugg"><img src="https://avatars0.githubusercontent.com/u/6054540?v=4" width="100px;" alt=""/><br /><sub><b>Robert M Lugg</b></sub></a><br /><a href="#content-robertlugg" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://hynek.me/about/"><img src="https://avatars3.githubusercontent.com/u/41240?v=4" width="100px;" alt=""/><br /><sub><b>Hynek Schlawack</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=hynek" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://spacekookie.de"><img src="https://avatars0.githubusercontent.com/u/7669898?v=4" width="100px;" alt=""/><br /><sub><b>Katharina Fey</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=spacekookie" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/lukabavdaz"><img src="https://avatars0.githubusercontent.com/u/9624558?v=4" width="100px;" alt=""/><br /><sub><b>lukabavdaz</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=lukabavdaz" title="Code">💻</a> <a href="#content-lukabavdaz" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://vestera.as"><img src="https://avatars2.githubusercontent.com/u/4187449?v=4" width="100px;" alt=""/><br /><sub><b>Erik Vesteraas</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=evestera" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/Delet0r"><img src="https://avatars1.githubusercontent.com/u/23195618?v=4" width="100px;" alt=""/><br /><sub><b>delet0r</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Delet0r" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://phinary.ca"><img src="https://avatars1.githubusercontent.com/u/10522375?v=4" width="100px;" alt=""/><br /><sub><b>Shaun Bennett</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=shaunbennett" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/abagshaw"><img src="https://avatars2.githubusercontent.com/u/8594541?v=4" width="100px;" alt=""/><br /><sub><b>Andrew Bagshaw</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=abagshaw" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://ai6ua.net/"><img src="https://avatars2.githubusercontent.com/u/175578?v=4" width="100px;" alt=""/><br /><sub><b>Kyle Isom</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=kisom" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/ColinPitrat"><img src="https://avatars3.githubusercontent.com/u/1541863?v=4" width="100px;" alt=""/><br /><sub><b>Colin Pitrat</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=ColinPitrat" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://zacanger.com"><img src="https://avatars3.githubusercontent.com/u/12520493?v=4" width="100px;" alt=""/><br /><sub><b>Zac Anger</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=zacanger" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/mgeier"><img src="https://avatars1.githubusercontent.com/u/705404?v=4" width="100px;" alt=""/><br /><sub><b>Matthias Geier</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=mgeier" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/cjpearce"><img src="https://avatars1.githubusercontent.com/u/3453268?v=4" width="100px;" alt=""/><br /><sub><b>Chris Pearce</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=cjpearce" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://yvan-sraka.github.io"><img src="https://avatars2.githubusercontent.com/u/705213?v=4" width="100px;" alt=""/><br /><sub><b>Yvan Sraka</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=yvan-sraka" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/dendi239"><img src="https://avatars3.githubusercontent.com/u/16478650?v=4" width="100px;" alt=""/><br /><sub><b>Denys Smirnov</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=dendi239" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/eddyp"><img src="https://avatars2.githubusercontent.com/u/123772?v=4" width="100px;" alt=""/><br /><sub><b>eddyp</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=eddyp" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://about.me/BrianKung"><img src="https://avatars1.githubusercontent.com/u/2836167?v=4" width="100px;" alt=""/><br /><sub><b>Brian Kung</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=briankung" title="Code">💻</a> <a href="#content-briankung" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://rcousineau.gitlab.io"><img src="https://avatars3.githubusercontent.com/u/281039?v=4" width="100px;" alt=""/><br /><sub><b>Russell</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=miller-time" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://danwilhelm.com"><img src="https://avatars3.githubusercontent.com/u/6137185?v=4" width="100px;" alt=""/><br /><sub><b>Dan Wilhelm</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=danwilhelm" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/Jesse-Cameron"><img src="https://avatars3.githubusercontent.com/u/3723654?v=4" width="100px;" alt=""/><br /><sub><b>Jesse</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Jesse-Cameron" title="Code">💻</a> <a href="#content-Jesse-Cameron" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/MrFroop"><img src="https://avatars3.githubusercontent.com/u/196700?v=4" width="100px;" alt=""/><br /><sub><b>Fredrik Jambrén</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=MrFroop" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/petemcfarlane"><img src="https://avatars3.githubusercontent.com/u/3472717?v=4" width="100px;" alt=""/><br /><sub><b>Pete McFarlane</b></sub></a><br /><a href="#content-petemcfarlane" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/nkanderson"><img src="https://avatars0.githubusercontent.com/u/4128825?v=4" width="100px;" alt=""/><br /><sub><b>nkanderson</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=nkanderson" title="Code">💻</a> <a href="#content-nkanderson" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/ajaxm"><img src="https://avatars0.githubusercontent.com/u/13360138?v=4" width="100px;" alt=""/><br /><sub><b>Ajax M</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=ajaxm" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://dylnuge.com"><img src="https://avatars2.githubusercontent.com/u/118624?v=4" width="100px;" alt=""/><br /><sub><b>Dylan Nugent</b></sub></a><br /><a href="#content-Dylnuge" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/vyaslav"><img src="https://avatars0.githubusercontent.com/u/1385427?v=4" width="100px;" alt=""/><br /><sub><b>vyaslav</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=vyaslav" title="Code">💻</a> <a href="#content-vyaslav" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://join.sfxd.org"><img src="https://avatars1.githubusercontent.com/u/17297466?v=4" width="100px;" alt=""/><br /><sub><b>George</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=gdoenlen" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/nyxtom"><img src="https://avatars2.githubusercontent.com/u/222763?v=4" width="100px;" alt=""/><br /><sub><b>Thomas Holloway</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=nyxtom" title="Code">💻</a> <a href="#content-nyxtom" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/workingjubilee"><img src="https://avatars1.githubusercontent.com/u/46493976?v=4" width="100px;" alt=""/><br /><sub><b>Jubilee</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=workingjubilee" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/WofWca"><img src="https://avatars1.githubusercontent.com/u/39462442?v=4" width="100px;" alt=""/><br /><sub><b>WofWca</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=WofWca" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/jrvidal"><img src="https://avatars0.githubusercontent.com/u/1636604?v=4" width="100px;" alt=""/><br /><sub><b>Roberto Vidal</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=jrvidal" title="Code">💻</a> <a href="https://github.com/rust-lang/rustlings/commits?author=jrvidal" title="Documentation">📖</a> <a href="#ideas-jrvidal" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-jrvidal" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://github.com/jensim"><img src="https://avatars0.githubusercontent.com/u/3663856?v=4" width="100px;" alt=""/><br /><sub><b>Jens</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=jensim" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="http://rahatah.me/d"><img src="https://avatars3.githubusercontent.com/u/3174006?v=4" width="100px;" alt=""/><br /><sub><b>Rahat Ahmed</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=rahatarmanahmed" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/AbdouSeck"><img src="https://avatars2.githubusercontent.com/u/6490055?v=4" width="100px;" alt=""/><br /><sub><b>Abdou Seck</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=AbdouSeck" title="Code">💻</a> <a href="#content-AbdouSeck" title="Content">🖋</a> <a href="https://github.com/rust-lang/rustlings/pulls?q=is%3Apr+reviewed-by%3AAbdouSeck" title="Reviewed Pull Requests">👀</a></td>
|
||||
<td align="center"><a href="https://codehearts.com"><img src="https://avatars0.githubusercontent.com/u/2885412?v=4" width="100px;" alt=""/><br /><sub><b>Katie</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=codehearts" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/Socratides"><img src="https://avatars3.githubusercontent.com/u/27732983?v=4" width="100px;" alt=""/><br /><sub><b>Socrates</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Socratides" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/gnodarse"><img src="https://avatars3.githubusercontent.com/u/46761795?v=4" width="100px;" alt=""/><br /><sub><b>gnodarse</b></sub></a><br /><a href="#content-gnodarse" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/harrisonmetz"><img src="https://avatars1.githubusercontent.com/u/7883408?v=4" width="100px;" alt=""/><br /><sub><b>Harrison Metzger</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=harrisonmetz" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/TorbenJ"><img src="https://avatars2.githubusercontent.com/u/9077102?v=4" width="100px;" alt=""/><br /><sub><b>Torben Jonas</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=TorbenJ" title="Code">💻</a> <a href="#content-TorbenJ" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://paulbissex.com/"><img src="https://avatars0.githubusercontent.com/u/641?v=4" width="100px;" alt=""/><br /><sub><b>Paul Bissex</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=pbx" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/sjmann"><img src="https://avatars0.githubusercontent.com/u/6589896?v=4" width="100px;" alt=""/><br /><sub><b>Steven Mann</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=sjmann" title="Code">💻</a> <a href="#content-sjmann" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://smmdb.net/"><img src="https://avatars2.githubusercontent.com/u/5855071?v=4" width="100px;" alt=""/><br /><sub><b>Mario Reder</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Tarnadas" title="Code">💻</a> <a href="#content-Tarnadas" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://keybase.io/skim"><img src="https://avatars0.githubusercontent.com/u/47347?v=4" width="100px;" alt=""/><br /><sub><b>skim</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=sl4m" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/sanjaykdragon"><img src="https://avatars1.githubusercontent.com/u/10261698?v=4" width="100px;" alt=""/><br /><sub><b>Sanjay K</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=sanjaykdragon" title="Code">💻</a> <a href="#content-sanjaykdragon" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://www.rohanjain.in"><img src="https://avatars1.githubusercontent.com/u/343499?v=4" width="100px;" alt=""/><br /><sub><b>Rohan Jain</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=crodjer" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://www.saidaspen.se"><img src="https://avatars1.githubusercontent.com/u/7727687?v=4" width="100px;" alt=""/><br /><sub><b>Said Aspen</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=saidaspen" title="Code">💻</a> <a href="#content-saidaspen" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/uce"><img src="https://avatars3.githubusercontent.com/u/1756620?v=4" width="100px;" alt=""/><br /><sub><b>Ufuk Celebi</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=uce" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/lebedevsergey"><img src="https://avatars2.githubusercontent.com/u/7325764?v=4" width="100px;" alt=""/><br /><sub><b>lebedevsergey</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=lebedevsergey" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/avrong"><img src="https://avatars2.githubusercontent.com/u/6342851?v=4" width="100px;" alt=""/><br /><sub><b>Aleksei Trifonov</b></sub></a><br /><a href="#content-avrong" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://drn.ie"><img src="https://avatars2.githubusercontent.com/u/411136?v=4" width="100px;" alt=""/><br /><sub><b>Darren Meehan</b></sub></a><br /><a href="#content-Darrenmeehan" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/jihchi"><img src="https://avatars1.githubusercontent.com/u/87983?v=4" width="100px;" alt=""/><br /><sub><b>Jihchi Lee</b></sub></a><br /><a href="#content-jihchi" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/bertonha"><img src="https://avatars3.githubusercontent.com/u/1225902?v=4" width="100px;" alt=""/><br /><sub><b>Christofer Bertonha</b></sub></a><br /><a href="#content-bertonha" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/apatniv"><img src="https://avatars2.githubusercontent.com/u/22565917?v=4" width="100px;" alt=""/><br /><sub><b>Vivek Bharath Akupatni</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=apatniv" title="Code">💻</a> <a href="https://github.com/rust-lang/rustlings/commits?author=apatniv" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/DiD92"><img src="https://avatars3.githubusercontent.com/u/6002416?v=4" width="100px;" alt=""/><br /><sub><b>Dídac Sementé Fernández</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=DiD92" title="Code">💻</a> <a href="#content-DiD92" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/wrobstory"><img src="https://avatars3.githubusercontent.com/u/2601457?v=4" width="100px;" alt=""/><br /><sub><b>Rob Story</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=wrobstory" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/siobhanjacobson"><img src="https://avatars2.githubusercontent.com/u/28983835?v=4" width="100px;" alt=""/><br /><sub><b>Siobhan Jacobson</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=siobhanjacobson" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://www.linkedin.com/in/evancarroll/"><img src="https://avatars2.githubusercontent.com/u/19922?v=4" width="100px;" alt=""/><br /><sub><b>Evan Carroll</b></sub></a><br /><a href="#content-EvanCarroll" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="http://www.jawaadmahmood.com"><img src="https://avatars3.githubusercontent.com/u/95606?v=4" width="100px;" alt=""/><br /><sub><b>Jawaad Mahmood</b></sub></a><br /><a href="#content-jmahmood" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/GaurangTandon"><img src="https://avatars1.githubusercontent.com/u/6308683?v=4" width="100px;" alt=""/><br /><sub><b>Gaurang Tandon</b></sub></a><br /><a href="#content-GaurangTandon" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/dev-cyprium"><img src="https://avatars1.githubusercontent.com/u/6002628?v=4" width="100px;" alt=""/><br /><sub><b>Stefan Kupresak</b></sub></a><br /><a href="#content-dev-cyprium" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/greg-el"><img src="https://avatars3.githubusercontent.com/u/45019882?v=4" width="100px;" alt=""/><br /><sub><b>Greg Leonard</b></sub></a><br /><a href="#content-greg-el" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://ryanpcmcquen.org"><img src="https://avatars3.githubusercontent.com/u/772937?v=4" width="100px;" alt=""/><br /><sub><b>Ryan McQuen</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=ryanpcmcquen" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/AnnikaCodes"><img src="https://avatars3.githubusercontent.com/u/56906084?v=4" width="100px;" alt=""/><br /><sub><b>Annika</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/pulls?q=is%3Apr+reviewed-by%3AAnnikaCodes" title="Reviewed Pull Requests">👀</a></td>
|
||||
<td align="center"><a href="https://darnuria.eu"><img src="https://avatars1.githubusercontent.com/u/2827553?v=4" width="100px;" alt=""/><br /><sub><b>Axel Viala</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=darnuria" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://sazid.github.io"><img src="https://avatars1.githubusercontent.com/u/2370167?v=4" width="100px;" alt=""/><br /><sub><b>Mohammed Sazid Al Rashid</b></sub></a><br /><a href="#content-sazid" title="Content">🖋</a> <a href="https://github.com/rust-lang/rustlings/commits?author=sazid" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://codingthemsoftly.com"><img src="https://avatars1.githubusercontent.com/u/17479099?v=4" width="100px;" alt=""/><br /><sub><b>Caleb Webber</b></sub></a><br /><a href="#maintenance-seeplusplus" title="Maintenance">🚧</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-enable -->
|
||||
<!-- prettier-ignore-end -->
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
||||
Thanks goes to the wonderful people listed in [AUTHORS.md](./AUTHORS.md) 🎉
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
steps:
|
||||
- label: "Test with stable"
|
||||
command: rustup run stable cargo test
|
||||
- label: "Test with beta"
|
||||
command: rustup run beta cargo test
|
||||
@@ -1,19 +0,0 @@
|
||||
Thanks for installing Rustlings!
|
||||
|
||||
Is this your first time?
|
||||
|
||||
Let's make sure you're up to speed:
|
||||
- You have Rust installed, preferably via `rustup`
|
||||
- You have `~/.cargo/bin` added to your PATH variable
|
||||
- You have cloned this repository (https://github.com/rust-lang/rustlings)
|
||||
- You have installed Rust language support for your editor
|
||||
- You have locally installed the `rustlings` command by running an
|
||||
installation script or manually executing:
|
||||
|
||||
cargo install --force --path .
|
||||
|
||||
If you've done all of this (or even most of it), congrats! You're ready
|
||||
to start working with Rust.
|
||||
|
||||
To get started, run `rustlings watch` in order to get the first exercise.
|
||||
Make sure to have your editor open!
|
||||
24
exercises/README.md
Normal file
24
exercises/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Exercise to Book Chapter mapping
|
||||
|
||||
| Exercise | Book Chapter |
|
||||
|------------------------|--------------|
|
||||
| variables | §3.1 |
|
||||
| functions | §3.3 |
|
||||
| if | §3.5 |
|
||||
| move_semantics | §4.1 |
|
||||
| primitive_types | §4.3 |
|
||||
| structs | §5.1 |
|
||||
| enums | §6 |
|
||||
| modules | §7 |
|
||||
| collections | §8.1, §8.3 |
|
||||
| strings | §8.2 |
|
||||
| error_handling | §9 |
|
||||
| generics | §10 |
|
||||
| option | §10.1 |
|
||||
| traits | §10.2 |
|
||||
| tests | §11.1 |
|
||||
| standard_library_types | §13.2 |
|
||||
| threads | §16.1 |
|
||||
| macros | §19.6 |
|
||||
| clippy | n/a |
|
||||
| conversions | n/a |
|
||||
98
exercises/advanced_errors/advanced_errs1.rs
Normal file
98
exercises/advanced_errors/advanced_errs1.rs
Normal file
@@ -0,0 +1,98 @@
|
||||
// advanced_errs1.rs
|
||||
|
||||
// Remember back in errors6, we had multiple mapping functions so that we
|
||||
// could translate lower-level errors into our custom error type using
|
||||
// `map_err()`? What if we could use the `?` operator directly instead?
|
||||
|
||||
// Make this code compile! Execute `rustlings hint advanced_errs1` for
|
||||
// hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::num::ParseIntError;
|
||||
use std::str::FromStr;
|
||||
|
||||
// This is a custom error type that we will be using in the `FromStr`
|
||||
// implementation.
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum ParsePosNonzeroError {
|
||||
Creation(CreationError),
|
||||
ParseInt(ParseIntError),
|
||||
}
|
||||
|
||||
impl From<CreationError> for ParsePosNonzeroError {
|
||||
fn from(e: CreationError) -> Self {
|
||||
// TODO: complete this implementation so that the `?` operator will
|
||||
// work for `CreationError`
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: implement another instance of the `From` trait here so that the
|
||||
// `?` operator will work in the other place in the `FromStr`
|
||||
// implementation below.
|
||||
|
||||
// Don't change anything below this line.
|
||||
|
||||
impl FromStr for PositiveNonzeroInteger {
|
||||
type Err = ParsePosNonzeroError;
|
||||
fn from_str(s: &str) -> Result<PositiveNonzeroInteger, Self::Err> {
|
||||
let x: i64 = s.parse()?;
|
||||
Ok(PositiveNonzeroInteger::new(x)?)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
struct PositiveNonzeroInteger(u64);
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum CreationError {
|
||||
Negative,
|
||||
Zero,
|
||||
}
|
||||
|
||||
impl PositiveNonzeroInteger {
|
||||
fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
|
||||
match value {
|
||||
x if x < 0 => Err(CreationError::Negative),
|
||||
x if x == 0 => Err(CreationError::Zero),
|
||||
x => Ok(PositiveNonzeroInteger(x as u64)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_parse_error() {
|
||||
// We can't construct a ParseIntError, so we have to pattern match.
|
||||
assert!(matches!(
|
||||
PositiveNonzeroInteger::from_str("not a number"),
|
||||
Err(ParsePosNonzeroError::ParseInt(_))
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_negative() {
|
||||
assert_eq!(
|
||||
PositiveNonzeroInteger::from_str("-555"),
|
||||
Err(ParsePosNonzeroError::Creation(CreationError::Negative))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_zero() {
|
||||
assert_eq!(
|
||||
PositiveNonzeroInteger::from_str("0"),
|
||||
Err(ParsePosNonzeroError::Creation(CreationError::Zero))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_positive() {
|
||||
let x = PositiveNonzeroInteger::new(42);
|
||||
assert!(x.is_ok());
|
||||
assert_eq!(PositiveNonzeroInteger::from_str("42"), Ok(x.unwrap()));
|
||||
}
|
||||
}
|
||||
202
exercises/advanced_errors/advanced_errs2.rs
Normal file
202
exercises/advanced_errors/advanced_errs2.rs
Normal file
@@ -0,0 +1,202 @@
|
||||
// advanced_errs2.rs
|
||||
|
||||
// This exercise demonstrates a few traits that are useful for custom error
|
||||
// types to implement, especially so that other code can consume the custom
|
||||
// error type more usefully.
|
||||
|
||||
// Make this compile, and make the tests pass!
|
||||
// Execute `rustlings hint advanced_errs2` for hints.
|
||||
|
||||
// Steps:
|
||||
// 1. Implement a missing trait so that `main()` will compile.
|
||||
// 2. Complete the partial implementation of `From` for
|
||||
// `ParseClimateError`.
|
||||
// 3. Handle the missing error cases in the `FromStr` implementation for
|
||||
// `Climate`.
|
||||
// 4. Complete the partial implementation of `Display` for
|
||||
// `ParseClimateError`.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::error::Error;
|
||||
use std::fmt::{self, Display, Formatter};
|
||||
use std::num::{ParseFloatError, ParseIntError};
|
||||
use std::str::FromStr;
|
||||
|
||||
// This is the custom error type that we will be using for the parser for
|
||||
// `Climate`.
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum ParseClimateError {
|
||||
Empty,
|
||||
BadLen,
|
||||
NoCity,
|
||||
ParseInt(ParseIntError),
|
||||
ParseFloat(ParseFloatError),
|
||||
}
|
||||
|
||||
// This `From` implementation allows the `?` operator to work on
|
||||
// `ParseIntError` values.
|
||||
impl From<ParseIntError> for ParseClimateError {
|
||||
fn from(e: ParseIntError) -> Self {
|
||||
Self::ParseInt(e)
|
||||
}
|
||||
}
|
||||
|
||||
// This `From` implementation allows the `?` operator to work on
|
||||
// `ParseFloatError` values.
|
||||
impl From<ParseFloatError> for ParseClimateError {
|
||||
fn from(e: ParseFloatError) -> Self {
|
||||
// TODO: Complete this function
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Implement a missing trait so that `main()` below will compile. It
|
||||
// is not necessary to implement any methods inside the missing trait.
|
||||
|
||||
// The `Display` trait allows for other code to obtain the error formatted
|
||||
// as a user-visible string.
|
||||
impl Display for ParseClimateError {
|
||||
// TODO: Complete this function so that it produces the correct strings
|
||||
// for each error variant.
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
// Imports the variants to make the following code more compact.
|
||||
use ParseClimateError::*;
|
||||
match self {
|
||||
NoCity => write!(f, "no city name"),
|
||||
ParseFloat(e) => write!(f, "error parsing temperature: {}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
struct Climate {
|
||||
city: String,
|
||||
year: u32,
|
||||
temp: f32,
|
||||
}
|
||||
|
||||
// Parser for `Climate`.
|
||||
// 1. Split the input string into 3 fields: city, year, temp.
|
||||
// 2. Return an error if the string is empty or has the wrong number of
|
||||
// fields.
|
||||
// 3. Return an error if the city name is empty.
|
||||
// 4. Parse the year as a `u32` and return an error if that fails.
|
||||
// 5. Parse the temp as a `f32` and return an error if that fails.
|
||||
// 6. Return an `Ok` value containing the completed `Climate` value.
|
||||
impl FromStr for Climate {
|
||||
type Err = ParseClimateError;
|
||||
// TODO: Complete this function by making it handle the missing error
|
||||
// cases.
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let v: Vec<_> = s.split(',').collect();
|
||||
let (city, year, temp) = match &v[..] {
|
||||
[city, year, temp] => (city.to_string(), year, temp),
|
||||
_ => return Err(ParseClimateError::BadLen),
|
||||
};
|
||||
let year: u32 = year.parse()?;
|
||||
let temp: f32 = temp.parse()?;
|
||||
Ok(Climate { city, year, temp })
|
||||
}
|
||||
}
|
||||
|
||||
// Don't change anything below this line (other than to enable ignored
|
||||
// tests).
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
println!("{:?}", "Hong Kong,1999,25.7".parse::<Climate>()?);
|
||||
println!("{:?}", "".parse::<Climate>()?);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
#[test]
|
||||
fn test_empty() {
|
||||
let res = "".parse::<Climate>();
|
||||
assert_eq!(res, Err(ParseClimateError::Empty));
|
||||
assert_eq!(res.unwrap_err().to_string(), "empty input");
|
||||
}
|
||||
#[test]
|
||||
fn test_short() {
|
||||
let res = "Boston,1991".parse::<Climate>();
|
||||
assert_eq!(res, Err(ParseClimateError::BadLen));
|
||||
assert_eq!(res.unwrap_err().to_string(), "incorrect number of fields");
|
||||
}
|
||||
#[test]
|
||||
fn test_long() {
|
||||
let res = "Paris,1920,17.2,extra".parse::<Climate>();
|
||||
assert_eq!(res, Err(ParseClimateError::BadLen));
|
||||
assert_eq!(res.unwrap_err().to_string(), "incorrect number of fields");
|
||||
}
|
||||
#[test]
|
||||
fn test_no_city() {
|
||||
let res = ",1997,20.5".parse::<Climate>();
|
||||
assert_eq!(res, Err(ParseClimateError::NoCity));
|
||||
assert_eq!(res.unwrap_err().to_string(), "no city name");
|
||||
}
|
||||
#[test]
|
||||
fn test_parse_int_neg() {
|
||||
let res = "Barcelona,-25,22.3".parse::<Climate>();
|
||||
assert!(matches!(res, Err(ParseClimateError::ParseInt(_))));
|
||||
let err = res.unwrap_err();
|
||||
if let ParseClimateError::ParseInt(ref inner) = err {
|
||||
assert_eq!(
|
||||
err.to_string(),
|
||||
format!("error parsing year: {}", inner.to_string())
|
||||
);
|
||||
} else {
|
||||
unreachable!();
|
||||
};
|
||||
}
|
||||
#[test]
|
||||
fn test_parse_int_bad() {
|
||||
let res = "Beijing,foo,15.0".parse::<Climate>();
|
||||
assert!(matches!(res, Err(ParseClimateError::ParseInt(_))));
|
||||
let err = res.unwrap_err();
|
||||
if let ParseClimateError::ParseInt(ref inner) = err {
|
||||
assert_eq!(
|
||||
err.to_string(),
|
||||
format!("error parsing year: {}", inner.to_string())
|
||||
);
|
||||
} else {
|
||||
unreachable!();
|
||||
};
|
||||
}
|
||||
#[test]
|
||||
fn test_parse_float() {
|
||||
let res = "Manila,2001,bar".parse::<Climate>();
|
||||
assert!(matches!(res, Err(ParseClimateError::ParseFloat(_))));
|
||||
let err = res.unwrap_err();
|
||||
if let ParseClimateError::ParseFloat(ref inner) = err {
|
||||
assert_eq!(
|
||||
err.to_string(),
|
||||
format!("error parsing temperature: {}", inner.to_string())
|
||||
);
|
||||
} else {
|
||||
unreachable!();
|
||||
};
|
||||
}
|
||||
#[test]
|
||||
fn test_parse_good() {
|
||||
let res = "Munich,2015,23.1".parse::<Climate>();
|
||||
assert_eq!(
|
||||
res,
|
||||
Ok(Climate {
|
||||
city: "Munich".to_string(),
|
||||
year: 2015,
|
||||
temp: 23.1,
|
||||
})
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_downcast() {
|
||||
let res = "São Paulo,-21,28.5".parse::<Climate>();
|
||||
assert!(matches!(res, Err(ParseClimateError::ParseInt(_))));
|
||||
let err = res.unwrap_err();
|
||||
let inner: Option<&(dyn Error + 'static)> = err.source();
|
||||
assert!(inner.is_some());
|
||||
assert!(inner.unwrap().is::<ParseIntError>());
|
||||
}
|
||||
}
|
||||
2
exercises/advanced_errors/mod.rs
Normal file
2
exercises/advanced_errors/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod advanced_errs1;
|
||||
mod advanced_errs2;
|
||||
@@ -1,8 +1,10 @@
|
||||
### Clippy
|
||||
# Clippy
|
||||
|
||||
The Clippy tool is a collection of lints to analyze your code so you can catch common mistakes and improve your Rust code.
|
||||
|
||||
If you used the installation script for Rustlings, Clippy should be already installed.
|
||||
If not you can install it manually via `rustup component add clippy`.
|
||||
|
||||
For more information about Clippy lints, please see [their documentation page](https://rust-lang.github.io/rust-clippy/master/).
|
||||
## Further information
|
||||
|
||||
- [GitHub Repository](https://github.com/rust-lang/rust-clippy).
|
||||
|
||||
@@ -8,10 +8,16 @@
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::f32;
|
||||
|
||||
fn main() {
|
||||
let x = 1.2331f64;
|
||||
let y = 1.2332f64;
|
||||
if y != x {
|
||||
println!("Success!");
|
||||
}
|
||||
let pi = 3.14f32;
|
||||
let radius = 5.00f32;
|
||||
|
||||
let area = pi * f32::powi(radius, 2);
|
||||
|
||||
println!(
|
||||
"The area of a circle with radius {:.2} is {:.5}!",
|
||||
radius, area
|
||||
)
|
||||
}
|
||||
|
||||
2
exercises/clippy/mod.rs
Normal file
2
exercises/clippy/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod clippy1;
|
||||
mod clippy2;
|
||||
@@ -1,4 +1,4 @@
|
||||
### Collections
|
||||
# Collections
|
||||
|
||||
Rust’s standard library includes a number of very useful data
|
||||
structures called collections. Most other data types represent one
|
||||
@@ -14,7 +14,10 @@ structures that are used very often in Rust programs:
|
||||
* A *vector* allows you to store a variable number of values next to
|
||||
each other.
|
||||
* A *hash map* allows you to associate a value with a particular key.
|
||||
You may also know this by the names *map* in C++, *dictionary* in
|
||||
Python or an *associative array* in other languages.
|
||||
You may also know this by the names [*unordered map* in C++](https://en.cppreference.com/w/cpp/container/unordered_map),
|
||||
[*dictionary* in Python](https://docs.python.org/3/tutorial/datastructures.html#dictionaries) or an *associative array* in other languages.
|
||||
|
||||
[Rust book chapter](https://doc.rust-lang.org/stable/book/ch08-01-vectors.html)
|
||||
## Further information
|
||||
|
||||
- [Storing Lists of Values with Vectors](https://doc.rust-lang.org/stable/book/ch08-01-vectors.html)
|
||||
- [Storing Keys with Associated Values in Hash Maps](https://doc.rust-lang.org/book/ch08-03-hash-maps.html)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
//
|
||||
// Make me compile and pass the tests!
|
||||
//
|
||||
// Execute the command `rustlings hint collections3` if you need
|
||||
// Execute the command `rustlings hint hashmap1` if you need
|
||||
// hints.
|
||||
|
||||
// I AM NOT DONE
|
||||
@@ -39,8 +39,6 @@ mod tests {
|
||||
#[test]
|
||||
fn at_least_five_fruits() {
|
||||
let basket = fruit_basket();
|
||||
assert!(basket
|
||||
.values()
|
||||
.sum::<u32>() >= 5);
|
||||
assert!(basket.values().sum::<u32>() >= 5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
// represents the name of the fruit and the value represents how many
|
||||
// of that particular fruit is in the basket. You have to put *MORE
|
||||
// THAN 11* fruits in the basket. Three types of fruits - Apple (4),
|
||||
// Mango (2) and Lichi (5) are already given in the basket. You are
|
||||
// Mango (2) and Lychee (5) are already given in the basket. You are
|
||||
// not allowed to insert any more of these fruits!
|
||||
//
|
||||
// Make me pass the tests!
|
||||
//
|
||||
// Execute the command `rustlings hint collections4` if you need
|
||||
// Execute the command `rustlings hint hashmap2` if you need
|
||||
// hints.
|
||||
|
||||
// I AM NOT DONE
|
||||
@@ -21,7 +21,7 @@ enum Fruit {
|
||||
Apple,
|
||||
Banana,
|
||||
Mango,
|
||||
Lichi,
|
||||
Lychee,
|
||||
Pineapple,
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ fn fruit_basket(basket: &mut HashMap<Fruit, u32>) {
|
||||
Fruit::Apple,
|
||||
Fruit::Banana,
|
||||
Fruit::Mango,
|
||||
Fruit::Lichi,
|
||||
Fruit::Lychee,
|
||||
Fruit::Pineapple,
|
||||
];
|
||||
|
||||
@@ -49,7 +49,7 @@ mod tests {
|
||||
let mut basket = HashMap::<Fruit, u32>::new();
|
||||
basket.insert(Fruit::Apple, 4);
|
||||
basket.insert(Fruit::Mango, 2);
|
||||
basket.insert(Fruit::Lichi, 5);
|
||||
basket.insert(Fruit::Lychee, 5);
|
||||
|
||||
basket
|
||||
}
|
||||
@@ -60,7 +60,7 @@ mod tests {
|
||||
fruit_basket(&mut basket);
|
||||
assert_eq!(*basket.get(&Fruit::Apple).unwrap(), 4);
|
||||
assert_eq!(*basket.get(&Fruit::Mango).unwrap(), 2);
|
||||
assert_eq!(*basket.get(&Fruit::Lichi).unwrap(), 5);
|
||||
assert_eq!(*basket.get(&Fruit::Lychee).unwrap(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -68,16 +68,14 @@ mod tests {
|
||||
let mut basket = get_fruit_basket();
|
||||
fruit_basket(&mut basket);
|
||||
let count_fruit_kinds = basket.len();
|
||||
assert!(count_fruit_kinds == 5);
|
||||
assert!(count_fruit_kinds >= 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn greater_than_eleven_fruits() {
|
||||
let mut basket = get_fruit_basket();
|
||||
fruit_basket(&mut basket);
|
||||
let count = basket
|
||||
.values()
|
||||
.sum::<u32>();
|
||||
let count = basket.values().sum::<u32>();
|
||||
assert!(count > 11);
|
||||
}
|
||||
}
|
||||
|
||||
4
exercises/collections/mod.rs
Normal file
4
exercises/collections/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
mod hashmap1;
|
||||
mod hashmap2;
|
||||
mod vec1;
|
||||
mod vec2;
|
||||
@@ -2,7 +2,7 @@
|
||||
// Your task is to create a `Vec` which holds the exact same elements
|
||||
// as in the array `a`.
|
||||
// Make me compile and pass the test!
|
||||
// Execute the command `rustlings hint collections1` if you need hints.
|
||||
// Execute the command `rustlings hint vec1` if you need hints.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
@@ -20,6 +20,6 @@ mod tests {
|
||||
#[test]
|
||||
fn test_array_and_vec_similarity() {
|
||||
let (a, v) = array_and_vec();
|
||||
assert!(a.iter().zip(v.iter()).all(|(x, y)| x == y));
|
||||
assert_eq!(a, v[..]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// Make me pass the test!
|
||||
//
|
||||
// Execute the command `rustlings hint collections2` if you need
|
||||
// Execute the command `rustlings hint vec2` if you need
|
||||
// hints.
|
||||
|
||||
// I AM NOT DONE
|
||||
@@ -28,11 +28,6 @@ mod tests {
|
||||
let v: Vec<i32> = (1..).filter(|x| x % 2 == 0).take(5).collect();
|
||||
let ans = vec_loop(v.clone());
|
||||
|
||||
assert_eq!(
|
||||
ans,
|
||||
v.iter()
|
||||
.map(|x| x * 2)
|
||||
.collect::<Vec<i32>>()
|
||||
);
|
||||
assert_eq!(ans, v.iter().map(|x| x * 2).collect::<Vec<i32>>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
### Type conversions
|
||||
|
||||
# Type conversions
|
||||
|
||||
Rust offers a multitude of ways to convert a value of a given type into another type.
|
||||
|
||||
@@ -15,6 +14,8 @@ Furthermore, the `std::str` module offers a trait called [`FromStr`](https://doc
|
||||
|
||||
These should be the main ways ***within the standard library*** to convert data into your desired types.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
These are not directly covered in the book, but the standard library has great documentation for [conversions here](https://doc.rust-lang.org/std/convert/index.html). The `FromStr` trait is also covered [here](https://doc.rust-lang.org/std/str/trait.FromStr.html).
|
||||
These are not directly covered in the book, but the standard library has a great documentation for it.
|
||||
- [conversions](https://doc.rust-lang.org/std/convert/index.html)
|
||||
- [`FromStr` trait](https://doc.rust-lang.org/std/str/trait.FromStr.html)
|
||||
@@ -115,4 +115,18 @@ mod tests {
|
||||
assert_eq!(p.name, "John");
|
||||
assert_eq!(p.age, 30);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_trailing_comma() {
|
||||
let p: Person = Person::from("Mike,32,");
|
||||
assert_eq!(p.name, "John");
|
||||
assert_eq!(p.age, 30);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_trailing_comma_and_some_string() {
|
||||
let p: Person = Person::from("Mike,32,man");
|
||||
assert_eq!(p.name, "John");
|
||||
assert_eq!(p.age, 30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,45 @@
|
||||
// This does practically the same thing that TryFrom<&str> does.
|
||||
// from_str.rs
|
||||
// This is similar to from_into.rs, but this time we'll implement `FromStr`
|
||||
// and return errors instead of falling back to a default value.
|
||||
// Additionally, upon implementing FromStr, you can use the `parse` method
|
||||
// on strings to generate an object of the implementor type.
|
||||
// You can read more about it at https://doc.rust-lang.org/std/str/trait.FromStr.html
|
||||
use std::num::ParseIntError;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
struct Person {
|
||||
name: String,
|
||||
age: usize,
|
||||
}
|
||||
|
||||
// We will use this error type for the `FromStr` implementation.
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum ParsePersonError {
|
||||
// Empty input string
|
||||
Empty,
|
||||
// Incorrect number of fields
|
||||
BadLen,
|
||||
// Empty name field
|
||||
NoName,
|
||||
// Wrapped error from parse::<usize>()
|
||||
ParseInt(ParseIntError),
|
||||
}
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
// Steps:
|
||||
// 1. If the length of the provided string is 0, then return an error
|
||||
// 1. If the length of the provided string is 0, an error should be returned
|
||||
// 2. Split the given string on the commas present in it
|
||||
// 3. Extract the first element from the split operation and use it as the name
|
||||
// 4. If the name is empty, then return an error
|
||||
// 3. Only 2 elements should be returned from the split, otherwise return an error
|
||||
// 4. Extract the first element from the split operation and use it as the name
|
||||
// 5. Extract the other element from the split operation and parse it into a `usize` as the age
|
||||
// with something like `"4".parse::<usize>()`.
|
||||
// If while parsing the age, something goes wrong, then return an error
|
||||
// Otherwise, then return a Result of a Person object
|
||||
// with something like `"4".parse::<usize>()`
|
||||
// 6. If while extracting the name and the age something goes wrong, an error should be returned
|
||||
// If everything goes well, then return a Result of a Person object
|
||||
|
||||
impl FromStr for Person {
|
||||
type Err = String;
|
||||
type Err = ParsePersonError;
|
||||
fn from_str(s: &str) -> Result<Person, Self::Err> {
|
||||
}
|
||||
}
|
||||
@@ -37,7 +55,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn empty_input() {
|
||||
assert!("".parse::<Person>().is_err());
|
||||
assert_eq!("".parse::<Person>(), Err(ParsePersonError::Empty));
|
||||
}
|
||||
#[test]
|
||||
fn good_input() {
|
||||
@@ -48,38 +66,57 @@ mod tests {
|
||||
assert_eq!(p.age, 32);
|
||||
}
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn missing_age() {
|
||||
"John,".parse::<Person>().unwrap();
|
||||
assert!(matches!(
|
||||
"John,".parse::<Person>(),
|
||||
Err(ParsePersonError::ParseInt(_))
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn invalid_age() {
|
||||
"John,twenty".parse::<Person>().unwrap();
|
||||
assert!(matches!(
|
||||
"John,twenty".parse::<Person>(),
|
||||
Err(ParsePersonError::ParseInt(_))
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn missing_comma_and_age() {
|
||||
"John".parse::<Person>().unwrap();
|
||||
assert_eq!("John".parse::<Person>(), Err(ParsePersonError::BadLen));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn missing_name() {
|
||||
",1".parse::<Person>().unwrap();
|
||||
assert_eq!(",1".parse::<Person>(), Err(ParsePersonError::NoName));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn missing_name_and_age() {
|
||||
",".parse::<Person>().unwrap();
|
||||
assert!(matches!(
|
||||
",".parse::<Person>(),
|
||||
Err(ParsePersonError::NoName | ParsePersonError::ParseInt(_))
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn missing_name_and_invalid_age() {
|
||||
",one".parse::<Person>().unwrap();
|
||||
assert!(matches!(
|
||||
",one".parse::<Person>(),
|
||||
Err(ParsePersonError::NoName | ParsePersonError::ParseInt(_))
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn trailing_comma() {
|
||||
assert_eq!("John,32,".parse::<Person>(), Err(ParsePersonError::BadLen));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn trailing_comma_and_some_string() {
|
||||
assert_eq!(
|
||||
"John,32,man".parse::<Person>(),
|
||||
Err(ParsePersonError::BadLen)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
5
exercises/conversions/mod.rs
Normal file
5
exercises/conversions/mod.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
mod as_ref_mut;
|
||||
mod from_into;
|
||||
mod from_str;
|
||||
mod try_from_into;
|
||||
mod using_as;
|
||||
@@ -1,3 +1,4 @@
|
||||
// try_from_into.rs
|
||||
// TryFrom is a simple and safe type conversion that may fail in a controlled way under some circumstances.
|
||||
// Basically, this is the same as From. The main difference is that this should return a Result type
|
||||
// instead of the target type itself.
|
||||
@@ -11,33 +12,45 @@ struct Color {
|
||||
blue: u8,
|
||||
}
|
||||
|
||||
// We will use this error type for these `TryFrom` conversions.
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum IntoColorError {
|
||||
// Incorrect length of slice
|
||||
BadLen,
|
||||
// Integer conversion error
|
||||
IntConversion,
|
||||
}
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
// Your task is to complete this implementation
|
||||
// and return an Ok result of inner type Color.
|
||||
// You need create implementation for a tuple of three integer,
|
||||
// an array of three integer and slice of integer.
|
||||
// You need to create an implementation for a tuple of three integers,
|
||||
// an array of three integers, and a slice of integers.
|
||||
//
|
||||
// Note, that implementation for tuple and array will be checked at compile-time,
|
||||
// but slice implementation need check slice length!
|
||||
// Also note, that chunk of correct rgb color must be integer in range 0..=255.
|
||||
// Note that the implementation for tuple and array will be checked at compile time,
|
||||
// but the slice implementation needs to check the slice length!
|
||||
// Also note that correct RGB color values must be integers in the 0..=255 range.
|
||||
|
||||
// Tuple implementation
|
||||
impl TryFrom<(i16, i16, i16)> for Color {
|
||||
type Error = String;
|
||||
fn try_from(tuple: (i16, i16, i16)) -> Result<Self, Self::Error> {}
|
||||
type Error = IntoColorError;
|
||||
fn try_from(tuple: (i16, i16, i16)) -> Result<Self, Self::Error> {
|
||||
}
|
||||
}
|
||||
|
||||
// Array implementation
|
||||
impl TryFrom<[i16; 3]> for Color {
|
||||
type Error = String;
|
||||
fn try_from(arr: [i16; 3]) -> Result<Self, Self::Error> {}
|
||||
type Error = IntoColorError;
|
||||
fn try_from(arr: [i16; 3]) -> Result<Self, Self::Error> {
|
||||
}
|
||||
}
|
||||
|
||||
// Slice implementation
|
||||
impl TryFrom<&[i16]> for Color {
|
||||
type Error = String;
|
||||
fn try_from(slice: &[i16]) -> Result<Self, Self::Error> {}
|
||||
type Error = IntoColorError;
|
||||
fn try_from(slice: &[i16]) -> Result<Self, Self::Error> {
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@@ -45,15 +58,15 @@ fn main() {
|
||||
let c1 = Color::try_from((183, 65, 14));
|
||||
println!("{:?}", c1);
|
||||
|
||||
// Since From is implemented for Color, we should be able to use Into
|
||||
// Since TryFrom is implemented for Color, we should be able to use TryInto
|
||||
let c2: Result<Color, _> = [183, 65, 14].try_into();
|
||||
println!("{:?}", c2);
|
||||
|
||||
let v = vec![183, 65, 14];
|
||||
// With slice we should use `from` function
|
||||
// With slice we should use `try_from` function
|
||||
let c3 = Color::try_from(&v[..]);
|
||||
println!("{:?}", c3);
|
||||
// or take slice within round brackets and use Into
|
||||
// or take slice within round brackets and use TryInto
|
||||
let c4: Result<Color, _> = (&v[..]).try_into();
|
||||
println!("{:?}", c4);
|
||||
}
|
||||
@@ -64,92 +77,112 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_tuple_out_of_range_positive() {
|
||||
assert!(Color::try_from((256, 1000, 10000)).is_err());
|
||||
assert_eq!(
|
||||
Color::try_from((256, 1000, 10000)),
|
||||
Err(IntoColorError::IntConversion)
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_tuple_out_of_range_negative() {
|
||||
assert!(Color::try_from((-1, -10, -256)).is_err());
|
||||
assert_eq!(
|
||||
Color::try_from((-1, -10, -256)),
|
||||
Err(IntoColorError::IntConversion)
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_tuple_sum() {
|
||||
assert!(Color::try_from((-1, 255, 255)).is_err());
|
||||
assert_eq!(
|
||||
Color::try_from((-1, 255, 255)),
|
||||
Err(IntoColorError::IntConversion)
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_tuple_correct() {
|
||||
let c: Result<Color, String> = (183, 65, 14).try_into();
|
||||
let c: Result<Color, _> = (183, 65, 14).try_into();
|
||||
assert!(c.is_ok());
|
||||
assert_eq!(
|
||||
c,
|
||||
Ok(Color {
|
||||
c.unwrap(),
|
||||
Color {
|
||||
red: 183,
|
||||
green: 65,
|
||||
blue: 14
|
||||
})
|
||||
}
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_array_out_of_range_positive() {
|
||||
let c: Color = [1000, 10000, 256].try_into();
|
||||
assert!(c.is_err());
|
||||
let c: Result<Color, _> = [1000, 10000, 256].try_into();
|
||||
assert_eq!(c, Err(IntoColorError::IntConversion));
|
||||
}
|
||||
#[test]
|
||||
fn test_array_out_of_range_negative() {
|
||||
let c: Color = [-10, -256, -1].try_into();
|
||||
assert!(c.is_err());
|
||||
let c: Result<Color, _> = [-10, -256, -1].try_into();
|
||||
assert_eq!(c, Err(IntoColorError::IntConversion));
|
||||
}
|
||||
#[test]
|
||||
fn test_array_sum() {
|
||||
let c: Color = [-1, 255, 255].try_into();
|
||||
assert!(c.is_err());
|
||||
let c: Result<Color, _> = [-1, 255, 255].try_into();
|
||||
assert_eq!(c, Err(IntoColorError::IntConversion));
|
||||
}
|
||||
#[test]
|
||||
#[test]
|
||||
fn test_array_correct() {
|
||||
let c: Result<Color, String> = [183, 65, 14].try_into();
|
||||
let c: Result<Color, _> = [183, 65, 14].try_into();
|
||||
assert!(c.is_ok());
|
||||
assert_eq!(
|
||||
c,
|
||||
Ok(Color {
|
||||
c.unwrap(),
|
||||
Color {
|
||||
red: 183,
|
||||
green: 65,
|
||||
blue: 14
|
||||
})
|
||||
}
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_slice_out_of_range_positive() {
|
||||
let arr = [10000, 256, 1000];
|
||||
assert!(Color::try_from(&arr[..]).is_err());
|
||||
assert_eq!(
|
||||
Color::try_from(&arr[..]),
|
||||
Err(IntoColorError::IntConversion)
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_slice_out_of_range_negative() {
|
||||
let arr = [-256, -1, -10];
|
||||
assert!(Color::try_from(&arr[..]).is_err());
|
||||
assert_eq!(
|
||||
Color::try_from(&arr[..]),
|
||||
Err(IntoColorError::IntConversion)
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_slice_sum() {
|
||||
let arr = [-1, 255, 255];
|
||||
assert!(Color::try_from(&arr[..]).is_err());
|
||||
assert_eq!(
|
||||
Color::try_from(&arr[..]),
|
||||
Err(IntoColorError::IntConversion)
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_slice_correct() {
|
||||
let v = vec![183, 65, 14];
|
||||
let c: Result<Color, String> = Color::try_from(&v[..]);
|
||||
let c: Result<Color, _> = Color::try_from(&v[..]);
|
||||
assert!(c.is_ok());
|
||||
assert_eq!(
|
||||
c,
|
||||
Ok(Color {
|
||||
c.unwrap(),
|
||||
Color {
|
||||
red: 183,
|
||||
green: 65,
|
||||
blue: 14
|
||||
})
|
||||
}
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_slice_excess_length() {
|
||||
let v = vec![0, 0, 0, 0];
|
||||
assert!(Color::try_from(&v[..]).is_err());
|
||||
assert_eq!(Color::try_from(&v[..]), Err(IntoColorError::BadLen));
|
||||
}
|
||||
#[test]
|
||||
fn test_slice_insufficient_length() {
|
||||
let v = vec![0, 0];
|
||||
assert!(Color::try_from(&v[..]).is_err());
|
||||
assert_eq!(Color::try_from(&v[..]), Err(IntoColorError::BadLen));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// I AM NOT DONE
|
||||
|
||||
fn average(values: &[f64]) -> f64 {
|
||||
let total = values.iter().fold(0.0, |a, b| a + b);
|
||||
let total = values.iter().sum::<f64>();
|
||||
total / values.len()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
### Enums
|
||||
# Enums
|
||||
|
||||
Rust allows you to define types called "enums" which enumerate possible values.
|
||||
Enums are a feature in many languages, but their capabilities differ in each language. Rust’s enums are most similar to algebraic data types in functional languages, such as F#, OCaml, and Haskell.
|
||||
Useful in combination with enums is Rust's "pattern matching" facility, which makes it easy to run different code for different values of an enumeration.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Enums](https://doc.rust-lang.org/book/ch06-00-enums.html)
|
||||
- [Pattern syntax](https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html)
|
||||
|
||||
3
exercises/enums/mod.rs
Normal file
3
exercises/enums/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod enums1;
|
||||
mod enums2;
|
||||
mod enums3;
|
||||
@@ -1,5 +1,11 @@
|
||||
For this exercise check out the sections:
|
||||
# Error handling
|
||||
Most errors aren’t serious enough to require the program to stop entirely.
|
||||
Sometimes, when a function fails, it’s for a reason that you can easily interpret and respond to.
|
||||
For example, if you try to open a file and that operation fails because the file doesn’t exist, you might want to create the file instead of terminating the process.
|
||||
|
||||
## Further information
|
||||
|
||||
- [Error Handling](https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html)
|
||||
- [Generics](https://doc.rust-lang.org/book/ch10-01-syntax.html)
|
||||
|
||||
of the Rust Book.
|
||||
- [Result](https://doc.rust-lang.org/rust-by-example/error/result.html)
|
||||
- [Boxing errors](https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/boxing_errors.html)
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// errors1.rs
|
||||
// This function refuses to generate text to be printed on a nametag if
|
||||
// you pass it an empty string. It'd be nicer if it explained what the problem
|
||||
// was, instead of just sometimes returning `None`. The 2nd test currently
|
||||
// does not compile or pass, but it illustrates the behavior we would like
|
||||
// this function to have.
|
||||
// was, instead of just sometimes returning `None`. Thankfully, Rust has a similar
|
||||
// construct to `Option` that can be used to express error conditions. Let's use it!
|
||||
// Execute `rustlings hint errors1` for hints!
|
||||
|
||||
// I AM NOT DONE
|
||||
@@ -21,14 +20,11 @@ pub fn generate_nametag_text(name: String) -> Option<String> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
// This test passes initially if you comment out the 2nd test.
|
||||
// You'll need to update what this test expects when you change
|
||||
// the function under test!
|
||||
#[test]
|
||||
fn generates_nametag_text_for_a_nonempty_name() {
|
||||
assert_eq!(
|
||||
generate_nametag_text("Beyoncé".into()),
|
||||
Some("Hi! My name is Beyoncé".into())
|
||||
Ok("Hi! My name is Beyoncé".into())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,6 +32,7 @@ mod tests {
|
||||
fn explains_why_generating_nametag_text_fails() {
|
||||
assert_eq!(
|
||||
generate_nametag_text("".into()),
|
||||
// Don't change this line
|
||||
Err("`name` was empty; it must be nonempty.".into())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// result1.rs
|
||||
// Make this test pass! Execute `rustlings hint result1` for hints :)
|
||||
// errors4.rs
|
||||
// Make this test pass! Execute `rustlings hint errors4` for hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
53
exercises/error_handling/errors5.rs
Normal file
53
exercises/error_handling/errors5.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
// errors5.rs
|
||||
|
||||
// This program uses a completed version of the code from errors4.
|
||||
// It won't compile right now! Why?
|
||||
// Execute `rustlings hint errors5` for hints!
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
use std::num::ParseIntError;
|
||||
|
||||
// TODO: update the return type of `main()` to make this compile.
|
||||
fn main() -> Result<(), ParseIntError> {
|
||||
let pretend_user_input = "42";
|
||||
let x: i64 = pretend_user_input.parse()?;
|
||||
println!("output={:?}", PositiveNonzeroInteger::new(x)?);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Don't change anything below this line.
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
struct PositiveNonzeroInteger(u64);
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum CreationError {
|
||||
Negative,
|
||||
Zero,
|
||||
}
|
||||
|
||||
impl PositiveNonzeroInteger {
|
||||
fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
|
||||
match value {
|
||||
x if x < 0 => Err(CreationError::Negative),
|
||||
x if x == 0 => Err(CreationError::Zero),
|
||||
x => Ok(PositiveNonzeroInteger(x as u64))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is required so that `CreationError` can implement `error::Error`.
|
||||
impl fmt::Display for CreationError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let description = match *self {
|
||||
CreationError::Negative => "number is negative",
|
||||
CreationError::Zero => "number is zero",
|
||||
};
|
||||
f.write_str(description)
|
||||
}
|
||||
}
|
||||
|
||||
impl error::Error for CreationError {}
|
||||
92
exercises/error_handling/errors6.rs
Normal file
92
exercises/error_handling/errors6.rs
Normal file
@@ -0,0 +1,92 @@
|
||||
// errors6.rs
|
||||
|
||||
// Using catch-all error types like `Box<dyn error::Error>` isn't recommended
|
||||
// for library code, where callers might want to make decisions based on the
|
||||
// error content, instead of printing it out or propagating it further. Here,
|
||||
// we define a custom error type to make it possible for callers to decide
|
||||
// what to do next when our function returns an error.
|
||||
|
||||
// Make these tests pass! Execute `rustlings hint errors6` for hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::num::ParseIntError;
|
||||
|
||||
// This is a custom error type that we will be using in `parse_pos_nonzero()`.
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum ParsePosNonzeroError {
|
||||
Creation(CreationError),
|
||||
ParseInt(ParseIntError)
|
||||
}
|
||||
|
||||
impl ParsePosNonzeroError {
|
||||
// TODO: add another error conversion function here.
|
||||
}
|
||||
|
||||
fn parse_pos_nonzero(s: &str)
|
||||
-> Result<PositiveNonzeroInteger, ParsePosNonzeroError>
|
||||
{
|
||||
// TODO: change this to return an appropriate error instead of panicking
|
||||
// when `parse()` returns an error.
|
||||
let x: i64 = s.parse().unwrap();
|
||||
PositiveNonzeroInteger::new(x)
|
||||
.map_err(ParsePosNonzeroError::from_creation)
|
||||
}
|
||||
|
||||
// Don't change anything below this line.
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
struct PositiveNonzeroInteger(u64);
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum CreationError {
|
||||
Negative,
|
||||
Zero,
|
||||
}
|
||||
|
||||
impl PositiveNonzeroInteger {
|
||||
fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
|
||||
match value {
|
||||
x if x < 0 => Err(CreationError::Negative),
|
||||
x if x == 0 => Err(CreationError::Zero),
|
||||
x => Ok(PositiveNonzeroInteger(x as u64))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_parse_error() {
|
||||
// We can't construct a ParseIntError, so we have to pattern match.
|
||||
assert!(matches!(
|
||||
parse_pos_nonzero("not a number"),
|
||||
Err(ParsePosNonzeroError::ParseInt(_))
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_negative() {
|
||||
assert_eq!(
|
||||
parse_pos_nonzero("-555"),
|
||||
Err(ParsePosNonzeroError::Creation(CreationError::Negative))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_zero() {
|
||||
assert_eq!(
|
||||
parse_pos_nonzero("0"),
|
||||
Err(ParsePosNonzeroError::Creation(CreationError::Zero))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_positive() {
|
||||
let x = PositiveNonzeroInteger::new(42);
|
||||
assert!(x.is_ok());
|
||||
assert_eq!(parse_pos_nonzero("42"), Ok(x.unwrap()));
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
// errorsn.rs
|
||||
// This is a bigger error exercise than the previous ones!
|
||||
// You can do it! :)
|
||||
//
|
||||
// Edit the `read_and_validate` function ONLY. Don't create any Errors
|
||||
// that do not already exist.
|
||||
//
|
||||
// So many things could go wrong!
|
||||
//
|
||||
// - Reading from stdin could produce an io::Error
|
||||
// - Parsing the input could produce a num::ParseIntError
|
||||
// - Validating the input could produce a CreationError (defined below)
|
||||
//
|
||||
// How can we lump these errors into one general error? That is, what
|
||||
// type goes where the question marks are, and how do we return
|
||||
// that type from the body of read_and_validate?
|
||||
//
|
||||
// Execute `rustlings hint errorsn` for hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
use std::io;
|
||||
|
||||
// PositiveNonzeroInteger is a struct defined below the tests.
|
||||
fn read_and_validate(b: &mut dyn io::BufRead) -> Result<PositiveNonzeroInteger, ???> {
|
||||
let mut line = String::new();
|
||||
b.read_line(&mut line);
|
||||
let num: i64 = line.trim().parse();
|
||||
let answer = PositiveNonzeroInteger::new(num);
|
||||
answer
|
||||
}
|
||||
|
||||
//
|
||||
// Nothing below this needs to be modified
|
||||
//
|
||||
|
||||
// This is a test helper function that turns a &str into a BufReader.
|
||||
fn test_with_str(s: &str) -> Result<PositiveNonzeroInteger, Box<dyn error::Error>> {
|
||||
let mut b = io::BufReader::new(s.as_bytes());
|
||||
read_and_validate(&mut b)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_success() {
|
||||
let x = test_with_str("42\n");
|
||||
assert_eq!(PositiveNonzeroInteger(42), x.unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_not_num() {
|
||||
let x = test_with_str("eleven billion\n");
|
||||
assert!(x.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_non_positive() {
|
||||
let x = test_with_str("-40\n");
|
||||
assert!(x.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ioerror() {
|
||||
struct Broken;
|
||||
impl io::Read for Broken {
|
||||
fn read(&mut self, _buf: &mut [u8]) -> io::Result<usize> {
|
||||
Err(io::Error::new(io::ErrorKind::BrokenPipe, "uh-oh!"))
|
||||
}
|
||||
}
|
||||
let mut b = io::BufReader::new(Broken);
|
||||
assert!(read_and_validate(&mut b).is_err());
|
||||
assert_eq!("uh-oh!", read_and_validate(&mut b).unwrap_err().to_string());
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
struct PositiveNonzeroInteger(u64);
|
||||
|
||||
impl PositiveNonzeroInteger {
|
||||
fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
|
||||
if value == 0 {
|
||||
Err(CreationError::Zero)
|
||||
} else if value < 0 {
|
||||
Err(CreationError::Negative)
|
||||
} else {
|
||||
Ok(PositiveNonzeroInteger(value as u64))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_positive_nonzero_integer_creation() {
|
||||
assert!(PositiveNonzeroInteger::new(10).is_ok());
|
||||
assert_eq!(
|
||||
Err(CreationError::Negative),
|
||||
PositiveNonzeroInteger::new(-10)
|
||||
);
|
||||
assert_eq!(Err(CreationError::Zero), PositiveNonzeroInteger::new(0));
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum CreationError {
|
||||
Negative,
|
||||
Zero,
|
||||
}
|
||||
|
||||
impl fmt::Display for CreationError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let description = match *self {
|
||||
CreationError::Negative => "Number is negative",
|
||||
CreationError::Zero => "Number is zero",
|
||||
};
|
||||
f.write_str(description)
|
||||
}
|
||||
}
|
||||
|
||||
impl error::Error for CreationError {}
|
||||
6
exercises/error_handling/mod.rs
Normal file
6
exercises/error_handling/mod.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
mod errors1;
|
||||
mod errors2;
|
||||
mod errors3;
|
||||
mod errors4;
|
||||
mod errors5;
|
||||
mod errors6;
|
||||
@@ -1,7 +1,7 @@
|
||||
### Functions
|
||||
# Functions
|
||||
|
||||
Here, you'll learn how to write functions and how Rust's compiler can trace things way back.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [How Functions Work](https://doc.rust-lang.org/book/ch03-03-how-functions-work.html)
|
||||
|
||||
@@ -7,7 +7,7 @@ fn main() {
|
||||
call_me(3);
|
||||
}
|
||||
|
||||
fn call_me(num) {
|
||||
fn call_me(num:) {
|
||||
for i in 0..num {
|
||||
println!("Ring! Call number {}", i + 1);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ fn main() {
|
||||
call_me();
|
||||
}
|
||||
|
||||
fn call_me(num: i32) {
|
||||
fn call_me(num: u32) {
|
||||
for i in 0..num {
|
||||
println!("Ring! Call number {}", i + 1);
|
||||
}
|
||||
|
||||
5
exercises/functions/mod.rs
Normal file
5
exercises/functions/mod.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
mod functions1;
|
||||
mod functions2;
|
||||
mod functions3;
|
||||
mod functions4;
|
||||
mod functions5;
|
||||
@@ -1,7 +1,11 @@
|
||||
### Generics
|
||||
# Generics
|
||||
|
||||
In this section you'll learn about saving yourself many lines of code with generics!
|
||||
Generics is the topic of generalizing types and functionalities to broader cases.
|
||||
This is extremely useful for reducing code duplication in many ways, but can call for rather involving syntax.
|
||||
Namely, being generic requires taking great care to specify over which types a generic type is actually considered valid.
|
||||
The simplest and most common use of generics is for type parameters.
|
||||
|
||||
### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Generic Data Types](https://doc.rust-lang.org/stable/book/ch10-01-syntax.html)
|
||||
- [Generic Data Types](https://doc.rust-lang.org/stable/book/ch10-01-syntax.html)
|
||||
- [Bounds](https://doc.rust-lang.org/rust-by-example/generics/bounds.html)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// This shopping list program isn't compiling!
|
||||
// Use your knowledge of generics to fix it.
|
||||
|
||||
// Execute `rustlings hint generics1` for hints!
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// This powerful wrapper provides the ability to store a positive integer value.
|
||||
// Rewrite it using generics so that it supports wrapping ANY type.
|
||||
|
||||
// Execute `rustlings hint generics2` for hints!
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
struct Wrapper {
|
||||
|
||||
3
exercises/generics/mod.rs
Normal file
3
exercises/generics/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod generics1;
|
||||
mod generics2;
|
||||
mod generics3;
|
||||
@@ -1,7 +1,7 @@
|
||||
### If
|
||||
# If
|
||||
|
||||
`if`, the most basic type of control flow, is what you'll learn here.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Control Flow - if expressions](https://doc.rust-lang.org/book/ch03-05-control-flow.html#if-expressions)
|
||||
|
||||
2
exercises/if/mod.rs
Normal file
2
exercises/if/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod if1;
|
||||
mod if2;
|
||||
8
exercises/intro/README.md
Normal file
8
exercises/intro/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Intro
|
||||
|
||||
Rust uses the `print!` and `println!` macros to print text to the console.
|
||||
|
||||
## Further information
|
||||
|
||||
- [Hello World](https://doc.rust-lang.org/rust-by-example/hello.html)
|
||||
- [Formatted print](https://doc.rust-lang.org/rust-by-example/hello/print.html)
|
||||
23
exercises/intro/intro1.rs
Normal file
23
exercises/intro/intro1.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
// intro1.rs
|
||||
// About this `I AM NOT DONE` thing:
|
||||
// We sometimes encourage you to keep trying things on a given exercise, even
|
||||
// after you already figured it out. If you got everything working and feel
|
||||
// ready for the next exercise, remove the `I AM NOT DONE` comment below.
|
||||
// Execute the command `rustlings hint intro1` for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
println!("Hello and");
|
||||
println!(r#" welcome to... "#);
|
||||
println!(r#" _ _ _ "#);
|
||||
println!(r#" _ __ _ _ ___| |_| (_)_ __ __ _ ___ "#);
|
||||
println!(r#" | '__| | | / __| __| | | '_ \ / _` / __| "#);
|
||||
println!(r#" | | | |_| \__ \ |_| | | | | | (_| \__ \ "#);
|
||||
println!(r#" |_| \__,_|___/\__|_|_|_| |_|\__, |___/ "#);
|
||||
println!(r#" |___/ "#);
|
||||
println!();
|
||||
println!("This exercise compiles successfully. The remaining exercises contain a compiler");
|
||||
println!("or logic error. The central concept behind Rustlings is to fix these errors and");
|
||||
println!("solve the exercises. Good luck!");
|
||||
}
|
||||
9
exercises/intro/intro2.rs
Normal file
9
exercises/intro/intro2.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
// intro2.rs
|
||||
// Make the code print a greeting to the world.
|
||||
// Execute `rustlings hint intro2` for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
println!("Hello {}!");
|
||||
}
|
||||
2
exercises/intro/mod.rs
Normal file
2
exercises/intro/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod intro1;
|
||||
mod intro2;
|
||||
@@ -1,10 +1,10 @@
|
||||
### Macros
|
||||
# Macros
|
||||
|
||||
Rust's macro system is very powerful, but also kind of difficult to wrap your
|
||||
head around. We're not going to teach you how to write your own fully-featured
|
||||
macros. Instead, we'll show you how to use and create them.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Macros](https://doc.rust-lang.org/book/ch19-06-macros.html)
|
||||
- [The Little Book of Rust Macros](https://danielkeep.github.io/tlborm/book/index.html)
|
||||
|
||||
4
exercises/macros/mod.rs
Normal file
4
exercises/macros/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
mod macros1;
|
||||
mod macros2;
|
||||
mod macros3;
|
||||
mod macros4;
|
||||
26
exercises/mod.rs
Normal file
26
exercises/mod.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
mod advanced_errors;
|
||||
mod clippy;
|
||||
mod collections;
|
||||
mod conversions;
|
||||
mod enums;
|
||||
mod error_handling;
|
||||
mod functions;
|
||||
mod generics;
|
||||
mod r#if;
|
||||
mod intro;
|
||||
mod macros;
|
||||
mod modules;
|
||||
mod move_semantics;
|
||||
mod option;
|
||||
mod primitive_types;
|
||||
mod quiz1;
|
||||
mod quiz2;
|
||||
mod quiz3;
|
||||
mod quiz4;
|
||||
mod standard_library_types;
|
||||
mod strings;
|
||||
mod structs;
|
||||
mod tests;
|
||||
mod threads;
|
||||
mod traits;
|
||||
mod variables;
|
||||
@@ -1,7 +1,7 @@
|
||||
### Modules
|
||||
# Modules
|
||||
|
||||
In this section we'll give you an introduction to Rust's module system.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [The Module System](https://doc.rust-lang.org/book/ch07-02-defining-modules-to-control-scope-and-privacy.html)
|
||||
- [The Module System](https://doc.rust-lang.org/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html)
|
||||
|
||||
3
exercises/modules/mod.rs
Normal file
3
exercises/modules/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod modules1;
|
||||
mod modules2;
|
||||
mod modules3;
|
||||
@@ -4,7 +4,13 @@
|
||||
// I AM NOT DONE
|
||||
|
||||
mod sausage_factory {
|
||||
// Don't let anybody outside of this module see this!
|
||||
fn get_secret_recipe() -> String {
|
||||
String::from("Ginger")
|
||||
}
|
||||
|
||||
fn make_sausage() {
|
||||
get_secret_recipe();
|
||||
println!("sausage!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
// modules2.rs
|
||||
// You can bring module paths into scopes and provide new names for them with the
|
||||
// 'use' and 'as' keywords. Fix these 'use' statements to make the code compile.
|
||||
// Make me compile! Execute `rustlings hint modules2` for hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
mod delicious_snacks {
|
||||
use self::fruits::PEAR as fruit;
|
||||
use self::veggies::CUCUMBER as veggie;
|
||||
|
||||
// TODO: Fix these use statements
|
||||
use self::fruits::PEAR as ???
|
||||
use self::veggies::CUCUMBER as ???
|
||||
|
||||
mod fruits {
|
||||
pub const PEAR: &'static str = "Pear";
|
||||
|
||||
18
exercises/modules/modules3.rs
Normal file
18
exercises/modules/modules3.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
// modules3.rs
|
||||
// You can use the 'use' keyword to bring module paths from modules from anywhere
|
||||
// and especially from the Rust standard library into your scope.
|
||||
// Bring SystemTime and UNIX_EPOCH
|
||||
// from the std::time module. Bonus style points if you can do it with one line!
|
||||
// Make me compile! Execute `rustlings hint modules3` for hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
// TODO: Complete this use statement
|
||||
use ???
|
||||
|
||||
fn main() {
|
||||
match SystemTime::now().duration_since(UNIX_EPOCH) {
|
||||
Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()),
|
||||
Err(_) => panic!("SystemTime before UNIX EPOCH!"),
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
### Move Semantics
|
||||
# Move Semantics
|
||||
|
||||
These exercises are adapted from [pnkfelix](https://github.com/pnkfelix)'s [Rust Tutorial](https://pnkfelix.github.io/rust-examples-icfp2014/) -- Thank you Felix!!!
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
For this section, the book links are especially important.
|
||||
|
||||
|
||||
6
exercises/move_semantics/mod.rs
Normal file
6
exercises/move_semantics/mod.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
mod move_semantics1;
|
||||
mod move_semantics2;
|
||||
mod move_semantics3;
|
||||
mod move_semantics4;
|
||||
mod move_semantics5;
|
||||
mod move_semantics6;
|
||||
@@ -1,5 +1,5 @@
|
||||
// move_semantics2.rs
|
||||
// Make me compile without changing line 13!
|
||||
// Make me compile without changing line 13 or moving line 10!
|
||||
// Execute `rustlings hint move_semantics2` for hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// move_semantics4.rs
|
||||
// Refactor this code so that instead of having `vec0` and creating the vector
|
||||
// in `fn main`, we instead create it within `fn fill_vec` and transfer the
|
||||
// in `fn main`, we create it within `fn fill_vec` and transfer the
|
||||
// freshly created vector from fill_vec to its caller.
|
||||
// Execute `rustlings hint move_semantics4` for hints!
|
||||
|
||||
@@ -18,7 +18,7 @@ fn main() {
|
||||
println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1);
|
||||
}
|
||||
|
||||
// `fill_vec()` no longer take `vec: Vec<i32>` as argument
|
||||
// `fill_vec()` no longer takes `vec: Vec<i32>` as argument
|
||||
fn fill_vec() -> Vec<i32> {
|
||||
let mut vec = vec;
|
||||
|
||||
|
||||
15
exercises/move_semantics/move_semantics5.rs
Normal file
15
exercises/move_semantics/move_semantics5.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
// move_semantics5.rs
|
||||
// Make me compile only by reordering the lines in `main()`, but without
|
||||
// adding, changing or removing any of them.
|
||||
// Execute `rustlings hint move_semantics5` for hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let mut x = 100;
|
||||
let y = &mut x;
|
||||
let z = &mut x;
|
||||
*y += 100;
|
||||
*z += 1000;
|
||||
assert_eq!(x, 1200);
|
||||
}
|
||||
25
exercises/move_semantics/move_semantics6.rs
Normal file
25
exercises/move_semantics/move_semantics6.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
// move_semantics6.rs
|
||||
// Make me compile! `rustlings hint move_semantics6` for hints
|
||||
// You can't change anything except adding or removing references
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let data = "Rust is great!".to_string();
|
||||
|
||||
get_char(data);
|
||||
|
||||
string_uppercase(&data);
|
||||
}
|
||||
|
||||
// Should not take ownership
|
||||
fn get_char(data: String) -> char {
|
||||
data.chars().last().unwrap()
|
||||
}
|
||||
|
||||
// Should take ownership
|
||||
fn string_uppercase(mut data: &String) {
|
||||
data = &data.to_uppercase();
|
||||
|
||||
println!("{}", data);
|
||||
}
|
||||
@@ -1,9 +1,20 @@
|
||||
### Option
|
||||
# Option
|
||||
|
||||
#### Book Sections
|
||||
Type Option represents an optional value: every Option is either Some and contains a value, or None, and does not.
|
||||
Option types are very common in Rust code, as they have a number of uses:
|
||||
- Initial values
|
||||
- Return values for functions that are not defined over their entire input range (partial functions)
|
||||
- Return value for otherwise reporting simple errors, where None is returned on error
|
||||
- Optional struct fields
|
||||
- Struct fields that can be loaned or "taken"
|
||||
- Optional function arguments
|
||||
- Nullable pointers
|
||||
- Swapping things out of difficult situations
|
||||
|
||||
To learn about Option<T>, check out these links:
|
||||
## Further Information
|
||||
|
||||
- [Option Enum Format](https://doc.rust-lang.org/stable/book/ch10-01-syntax.html#in-enum-definitions)
|
||||
- [Option Module Documentation](https://doc.rust-lang.org/std/option/)
|
||||
- [Option Enum Documentation](https://doc.rust-lang.org/std/option/enum.Option.html)
|
||||
- [if let](https://doc.rust-lang.org/rust-by-example/flow_control/if_let.html)
|
||||
- [while let](https://doc.rust-lang.org/rust-by-example/flow_control/while_let.html)
|
||||
|
||||
3
exercises/option/mod.rs
Normal file
3
exercises/option/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod option1;
|
||||
mod option2;
|
||||
mod option3;
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
// you can modify anything EXCEPT for this function's sig
|
||||
// you can modify anything EXCEPT for this function's signature
|
||||
fn print_number(maybe_number: Option<u16>) {
|
||||
println!("printing: {}", maybe_number.unwrap());
|
||||
}
|
||||
|
||||
@@ -4,22 +4,22 @@
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let optional_value = Some(String::from("rustlings"));
|
||||
let optional_word = Some(String::from("rustlings"));
|
||||
// TODO: Make this an if let statement whose value is "Some" type
|
||||
value = optional_value {
|
||||
println!("the value of optional value is: {}", value);
|
||||
word = optional_word {
|
||||
println!("The word is: {}", word);
|
||||
} else {
|
||||
println!("The optional value doesn't contain anything!");
|
||||
println!("The optional word doesn't contain anything");
|
||||
}
|
||||
|
||||
let mut optional_values_vec: Vec<Option<i8>> = Vec::new();
|
||||
let mut optional_integers_vec: Vec<Option<i8>> = Vec::new();
|
||||
for x in 1..10 {
|
||||
optional_values_vec.push(Some(x));
|
||||
optional_integers_vec.push(Some(x));
|
||||
}
|
||||
|
||||
// TODO: make this a while let statement - remember that vector.pop also adds another layer of Option<T>
|
||||
// You can stack `Option<T>`'s into while let and if let
|
||||
value = optional_values_vec.pop() {
|
||||
println!("current value: {}", value);
|
||||
integer = optional_integers_vec.pop() {
|
||||
println!("current value: {}", integer);
|
||||
}
|
||||
}
|
||||
|
||||
19
exercises/option/option3.rs
Normal file
19
exercises/option/option3.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
// option3.rs
|
||||
// Make me compile! Execute `rustlings hint option3` for hints
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
struct Point {
|
||||
x: i32,
|
||||
y: i32,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let y: Option<Point> = Some(Point { x: 100, y: 200 });
|
||||
|
||||
match y {
|
||||
Some(p) => println!("Co-ordinates are {},{} ", p.x, p.y),
|
||||
_ => println!("no match"),
|
||||
}
|
||||
y; // Fix without deleting this line.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
### Primitive Types
|
||||
# Primitive Types
|
||||
|
||||
Rust has a couple of basic types that are directly implemented into the
|
||||
compiler. In this section, we'll go through the most important ones.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Data Types](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html)
|
||||
- [The Slice Type](https://doc.rust-lang.org/stable/book/ch04-03-slices.html)
|
||||
|
||||
6
exercises/primitive_types/mod.rs
Normal file
6
exercises/primitive_types/mod.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
mod primitive_types1;
|
||||
mod primitive_types2;
|
||||
mod primitive_types3;
|
||||
mod primitive_types4;
|
||||
mod primitive_types5;
|
||||
mod primitive_types6;
|
||||
@@ -2,22 +2,25 @@
|
||||
// This is a quiz for the following sections:
|
||||
// - Variables
|
||||
// - Functions
|
||||
// - If
|
||||
|
||||
// Mary is buying apples. One apple usually costs 2 Rustbucks, but if you buy
|
||||
// more than 40 at once, each apple only costs 1! Write a function that calculates
|
||||
// the price of an order of apples given the order amount. No hints this time!
|
||||
// the price of an order of apples given the quantity bought. No hints this time!
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
// Put your function here!
|
||||
// fn ..... {
|
||||
// fn calculate_apple_price {
|
||||
|
||||
// Don't modify this function!
|
||||
#[test]
|
||||
fn verify_test() {
|
||||
let price1 = calculate_apple_price(35);
|
||||
let price2 = calculate_apple_price(65);
|
||||
let price2 = calculate_apple_price(40);
|
||||
let price3 = calculate_apple_price(65);
|
||||
|
||||
assert_eq!(70, price1);
|
||||
assert_eq!(65, price2);
|
||||
assert_eq!(80, price2);
|
||||
assert_eq!(65, price3);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn returns_twice_of_negative_numbers() {
|
||||
// TODO write an assert for `times_two(-4)`
|
||||
// TODO replace unimplemented!() with an assert for `times_two(-4)`
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
For the Box exercise check out the chapter [Using Box to Point to Data on the Heap](https://doc.rust-lang.org/book/ch15-01-box.html).
|
||||
# Standard library types
|
||||
|
||||
For the Arc exercise check out the chapter [Shared-State Concurrency](https://doc.rust-lang.org/book/ch16-03-shared-state.html) of the Rust Book.
|
||||
This section will teach you about Box, Shared-State Concurrency and Iterators.
|
||||
|
||||
For the Iterator exercise check out the chapters [Iterator](https://doc.rust-lang.org/book/ch13-02-iterators.html) of the Rust Book and the [Iterator documentation](https://doc.rust-lang.org/stable/std/iter/).
|
||||
## Further information
|
||||
|
||||
- [Using Box to Point to Data on the Heap](https://doc.rust-lang.org/book/ch15-01-box.html)
|
||||
- [Shared-State Concurrency](https://doc.rust-lang.org/book/ch16-03-shared-state.html)
|
||||
- [Iterator](https://doc.rust-lang.org/book/ch13-02-iterators.html)
|
||||
- [Iterator documentation](https://doc.rust-lang.org/stable/std/iter/)
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
// arc1.rs
|
||||
// In this exercise, we are given a Vec of u32 called "numbers" with values ranging
|
||||
// from 0 to 99 -- [ 0, 1, 2, ..., 98, 99 ]
|
||||
// We would like to use this set of numbers within 8 different threads simultaneously.
|
||||
// Each thread is going to get the sum of every eighth value, with an offset.
|
||||
// The first thread (offset 0), will sum 0, 8, 16, ...
|
||||
// The second thread (offset 1), will sum 1, 9, 17, ...
|
||||
// The third thread (offset 2), will sum 2, 10, 18, ...
|
||||
// ...
|
||||
// The eighth thread (offset 7), will sum 7, 15, 23, ...
|
||||
|
||||
// Because we are using threads, our values need to be thread-safe. Therefore,
|
||||
// we are using Arc. We need to make a change in each of the two TODOs.
|
||||
|
||||
|
||||
// Make this code compile by filling in a value for `shared_numbers` where the
|
||||
// TODO comment is and create an initial binding for `child_numbers`
|
||||
// somewhere. Try not to create any copies of the `numbers` Vec!
|
||||
// first TODO comment is, and create an initial binding for `child_numbers`
|
||||
// where the second TODO comment is. Try not to create any copies of the `numbers` Vec!
|
||||
// Execute `rustlings hint arc1` for hints :)
|
||||
|
||||
// I AM NOT DONE
|
||||
@@ -16,13 +30,9 @@ fn main() {
|
||||
let mut joinhandles = Vec::new();
|
||||
|
||||
for offset in 0..8 {
|
||||
let child_numbers = // TODO
|
||||
joinhandles.push(thread::spawn(move || {
|
||||
let mut i = offset;
|
||||
let mut sum = 0;
|
||||
while i < child_numbers.len() {
|
||||
sum += child_numbers[i];
|
||||
i += 8;
|
||||
}
|
||||
let sum: u32 = child_numbers.iter().filter(|n| *n % 8 == offset).sum();
|
||||
println!("Sum of offset {} is {}", offset, sum);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// iterators1.rs
|
||||
//
|
||||
//
|
||||
// Make me compile by filling in the `???`s
|
||||
//
|
||||
// When performing operations on elements within a collection, iterators are essential.
|
||||
// This module helps you get familiar with the structure of using an iterator and
|
||||
// This module helps you get familiar with the structure of using an iterator and
|
||||
// how to go through elements within an iterable collection.
|
||||
//
|
||||
//
|
||||
// Execute `rustlings hint iterators1` for hints :D
|
||||
|
||||
// I AM NOT DONE
|
||||
@@ -18,7 +18,7 @@ fn main () {
|
||||
assert_eq!(my_iterable_fav_fruits.next(), Some(&"banana"));
|
||||
assert_eq!(my_iterable_fav_fruits.next(), ???); // TODO: Step 2
|
||||
assert_eq!(my_iterable_fav_fruits.next(), Some(&"avocado"));
|
||||
assert_eq!(my_iterable_fav_fruits.next(), ???); // TODO: Step 2.1
|
||||
assert_eq!(my_iterable_fav_fruits.next(), Some(&"raspberry"));
|
||||
assert_eq!(my_iterable_fav_fruits.next(), ???); // TODO: Step 3
|
||||
assert_eq!(my_iterable_fav_fruits.next(), Some(&"raspberry"));
|
||||
assert_eq!(my_iterable_fav_fruits.next(), ???); // TODO: Step 4
|
||||
}
|
||||
|
||||
@@ -1,28 +1,41 @@
|
||||
// iterators2.rs
|
||||
// In this module, you'll learn some of the unique advantages that iterators can offer.
|
||||
// Step 1. Complete the `capitalize_first` function to pass the first two cases.
|
||||
// Step 2. Apply the `capitalize_first` function to a vector of strings.
|
||||
// Ensure that it returns a vector of strings as well.
|
||||
// Step 3. Apply the `capitalize_first` function again to a list.
|
||||
// Try to ensure it returns a single string.
|
||||
// In this exercise, you'll learn some of the unique advantages that iterators
|
||||
// can offer. Follow the steps to complete the exercise.
|
||||
// As always, there are hints if you execute `rustlings hint iterators2`!
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
// Step 1.
|
||||
// Complete the `capitalize_first` function.
|
||||
// "hello" -> "Hello"
|
||||
pub fn capitalize_first(input: &str) -> String {
|
||||
let mut c = input.chars();
|
||||
match c.next() {
|
||||
None => String::new(),
|
||||
Some(first) => first.collect::<String>() + c.as_str(),
|
||||
Some(first) => ???,
|
||||
}
|
||||
}
|
||||
|
||||
// Step 2.
|
||||
// Apply the `capitalize_first` function to a slice of string slices.
|
||||
// Return a vector of strings.
|
||||
// ["hello", "world"] -> ["Hello", "World"]
|
||||
pub fn capitalize_words_vector(words: &[&str]) -> Vec<String> {
|
||||
vec![]
|
||||
}
|
||||
|
||||
// Step 3.
|
||||
// Apply the `capitalize_first` function again to a slice of string slices.
|
||||
// Return a single string.
|
||||
// ["hello", " ", "world"] -> "Hello World"
|
||||
pub fn capitalize_words_string(words: &[&str]) -> String {
|
||||
String::new()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
// Step 1.
|
||||
// Tests that verify your `capitalize_first` function implementation
|
||||
#[test]
|
||||
fn test_success() {
|
||||
assert_eq!(capitalize_first("hello"), "Hello");
|
||||
@@ -33,18 +46,15 @@ mod tests {
|
||||
assert_eq!(capitalize_first(""), "");
|
||||
}
|
||||
|
||||
// Step 2.
|
||||
#[test]
|
||||
fn test_iterate_string_vec() {
|
||||
let words = vec!["hello", "world"];
|
||||
let capitalized_words: Vec<String> = // TODO
|
||||
assert_eq!(capitalized_words, ["Hello", "World"]);
|
||||
assert_eq!(capitalize_words_vector(&words), ["Hello", "World"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_iterate_into_string() {
|
||||
let words = vec!["hello", " ", "world"];
|
||||
let capitalized_words = // TODO
|
||||
assert_eq!(capitalized_words, "Hello World");
|
||||
assert_eq!(capitalize_words_string(&words), "Hello World");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// iterators3.rs
|
||||
// This is a bigger exercise than most of the others! You can do it!
|
||||
// Here is your mission, should you choose to accept it:
|
||||
// 1. Complete the divide function to get the first four tests to pass
|
||||
// 2. Uncomment the last two tests and get them to pass by filling in
|
||||
// values for `x` using `division_results`.
|
||||
// 1. Complete the divide function to get the first four tests to pass.
|
||||
// 2. Get the remaining tests to pass by completing the result_with_list and
|
||||
// list_of_results functions.
|
||||
// Execute `rustlings hint iterators3` to get some hints!
|
||||
// Have fun :-)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
@@ -21,16 +20,28 @@ pub struct NotDivisibleError {
|
||||
divisor: i32,
|
||||
}
|
||||
|
||||
// This function should calculate `a` divided by `b` if `a` is
|
||||
// evenly divisible by b.
|
||||
// Otherwise, it should return a suitable error.
|
||||
// Calculate `a` divided by `b` if `a` is evenly divisible by `b`.
|
||||
// Otherwise, return a suitable error.
|
||||
pub fn divide(a: i32, b: i32) -> Result<i32, DivisionError> {}
|
||||
|
||||
// Complete the function and return a value of the correct type so the test passes.
|
||||
// Desired output: Ok([1, 11, 1426, 3])
|
||||
fn result_with_list() -> () {
|
||||
let numbers = vec![27, 297, 38502, 81];
|
||||
let division_results = numbers.into_iter().map(|n| divide(n, 27));
|
||||
}
|
||||
|
||||
// Complete the function and return a value of the correct type so the test passes.
|
||||
// Desired output: [Ok(1), Ok(11), Ok(1426), Ok(3)]
|
||||
fn list_of_results() -> () {
|
||||
let numbers = vec![27, 297, 38502, 81];
|
||||
let division_results = numbers.into_iter().map(|n| divide(n, 27));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
// Tests that verify your `divide` function implementation
|
||||
#[test]
|
||||
fn test_success() {
|
||||
assert_eq!(divide(81, 9), Ok(9));
|
||||
@@ -57,22 +68,16 @@ mod tests {
|
||||
assert_eq!(divide(0, 81), Ok(0));
|
||||
}
|
||||
|
||||
// Iterator exercises using your `divide` function
|
||||
/*
|
||||
#[test]
|
||||
fn result_with_list() {
|
||||
let numbers = vec![27, 297, 38502, 81];
|
||||
let division_results = numbers.into_iter().map(|n| divide(n, 27));
|
||||
let x //... Fill in here!
|
||||
assert_eq!(format!("{:?}", x), "Ok([1, 11, 1426, 3])");
|
||||
fn test_result_with_list() {
|
||||
assert_eq!(format!("{:?}", result_with_list()), "Ok([1, 11, 1426, 3])");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_of_results() {
|
||||
let numbers = vec![27, 297, 38502, 81];
|
||||
let division_results = numbers.into_iter().map(|n| divide(n, 27));
|
||||
let x //... Fill in here!
|
||||
assert_eq!(format!("{:?}", x), "[Ok(1), Ok(11), Ok(1426), Ok(3)]");
|
||||
fn test_list_of_results() {
|
||||
assert_eq!(
|
||||
format!("{:?}", list_of_results()),
|
||||
"[Ok(1), Ok(11), Ok(1426), Ok(3)]"
|
||||
);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
122
exercises/standard_library_types/iterators5.rs
Normal file
122
exercises/standard_library_types/iterators5.rs
Normal file
@@ -0,0 +1,122 @@
|
||||
// iterators5.rs
|
||||
// Let's define a simple model to track Rustlings exercise progress. Progress
|
||||
// will be modelled using a hash map. The name of the exercise is the key and
|
||||
// the progress is the value. Two counting functions were created to count the
|
||||
// number of exercises with a given progress. These counting functions use
|
||||
// imperative style for loops. Recreate this counting functionality using
|
||||
// iterators. Only the two iterator methods (count_iterator and
|
||||
// count_collection_iterator) need to be modified.
|
||||
// Execute `rustlings hint iterators5` for hints.
|
||||
//
|
||||
// Make the code compile and the tests pass.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
enum Progress {
|
||||
None,
|
||||
Some,
|
||||
Complete,
|
||||
}
|
||||
|
||||
fn count_for(map: &HashMap<String, Progress>, value: Progress) -> usize {
|
||||
let mut count = 0;
|
||||
for val in map.values() {
|
||||
if val == &value {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
count
|
||||
}
|
||||
|
||||
fn count_iterator(map: &HashMap<String, Progress>, value: Progress) -> usize {
|
||||
// map is a hashmap with String keys and Progress values.
|
||||
// map = { "variables1": Complete, "from_str": None, ... }
|
||||
}
|
||||
|
||||
fn count_collection_for(collection: &[HashMap<String, Progress>], value: Progress) -> usize {
|
||||
let mut count = 0;
|
||||
for map in collection {
|
||||
for val in map.values() {
|
||||
if val == &value {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
count
|
||||
}
|
||||
|
||||
fn count_collection_iterator(collection: &[HashMap<String, Progress>], value: Progress) -> usize {
|
||||
// collection is a slice of hashmaps.
|
||||
// collection = [{ "variables1": Complete, "from_str": None, ... },
|
||||
// { "variables2": Complete, ... }, ... ]
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn count_complete() {
|
||||
let map = get_map();
|
||||
assert_eq!(3, count_iterator(&map, Progress::Complete));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn count_equals_for() {
|
||||
let map = get_map();
|
||||
assert_eq!(
|
||||
count_for(&map, Progress::Complete),
|
||||
count_iterator(&map, Progress::Complete)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn count_collection_complete() {
|
||||
let collection = get_vec_map();
|
||||
assert_eq!(
|
||||
6,
|
||||
count_collection_iterator(&collection, Progress::Complete)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn count_collection_equals_for() {
|
||||
let collection = get_vec_map();
|
||||
assert_eq!(
|
||||
count_collection_for(&collection, Progress::Complete),
|
||||
count_collection_iterator(&collection, Progress::Complete)
|
||||
);
|
||||
}
|
||||
|
||||
fn get_map() -> HashMap<String, Progress> {
|
||||
use Progress::*;
|
||||
|
||||
let mut map = HashMap::new();
|
||||
map.insert(String::from("variables1"), Complete);
|
||||
map.insert(String::from("functions1"), Complete);
|
||||
map.insert(String::from("hashmap1"), Complete);
|
||||
map.insert(String::from("arc1"), Some);
|
||||
map.insert(String::from("as_ref_mut"), None);
|
||||
map.insert(String::from("from_str"), None);
|
||||
|
||||
map
|
||||
}
|
||||
|
||||
fn get_vec_map() -> Vec<HashMap<String, Progress>> {
|
||||
use Progress::*;
|
||||
|
||||
let map = get_map();
|
||||
|
||||
let mut other = HashMap::new();
|
||||
other.insert(String::from("variables2"), Complete);
|
||||
other.insert(String::from("functions2"), Complete);
|
||||
other.insert(String::from("if1"), Complete);
|
||||
other.insert(String::from("from_into"), None);
|
||||
other.insert(String::from("try_from_into"), None);
|
||||
|
||||
vec![map, other]
|
||||
}
|
||||
}
|
||||
7
exercises/standard_library_types/mod.rs
Normal file
7
exercises/standard_library_types/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
mod arc1;
|
||||
mod box1;
|
||||
mod iterators1;
|
||||
mod iterators2;
|
||||
mod iterators3;
|
||||
mod iterators4;
|
||||
mod iterators5;
|
||||
@@ -1,9 +1,9 @@
|
||||
### Strings
|
||||
# Strings
|
||||
|
||||
Rust has two string types, a string slice (`&str`) and an owned string (`String`).
|
||||
We're not going to dictate when you should use which one, but we'll show you how
|
||||
to identify and create them, as well as use them.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Strings](https://doc.rust-lang.org/book/ch08-02-strings.html)
|
||||
|
||||
2
exercises/strings/mod.rs
Normal file
2
exercises/strings/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod strings1;
|
||||
mod strings2;
|
||||
@@ -1,7 +1,8 @@
|
||||
### Structs
|
||||
# Structs
|
||||
|
||||
Rust has three struct types: a classic c struct, a tuple struct, and a unit struct.
|
||||
Rust has three struct types: a classic C struct, a tuple struct, and a unit struct.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Structures](https://doc.rust-lang.org/rust-by-example/custom_types/structs.html)
|
||||
- [Structures](https://doc.rust-lang.org/book/ch05-01-defining-structs.html)
|
||||
- [Method Syntax](https://doc.rust-lang.org/book/ch05-03-method-syntax.html)
|
||||
|
||||
3
exercises/structs/mod.rs
Normal file
3
exercises/structs/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod structs1;
|
||||
mod structs2;
|
||||
mod structs3;
|
||||
@@ -1,7 +1,8 @@
|
||||
// structs3.rs
|
||||
// Structs contain more than simply some data, they can also have logic, in this
|
||||
// exercise we have defined the Package struct and we want to test some logic attached to it,
|
||||
// make the code compile and the tests pass! If you have issues execute `rustlings hint structs3`
|
||||
// Structs contain data, but can also have logic. In this exercise we have
|
||||
// defined the Package struct and we want to test some logic attached to it.
|
||||
// Make the code compile and the tests pass!
|
||||
// If you have issues execute `rustlings hint structs3`
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
@@ -15,13 +16,13 @@ struct Package {
|
||||
impl Package {
|
||||
fn new(sender_country: String, recipient_country: String, weight_in_grams: i32) -> Package {
|
||||
if weight_in_grams <= 0 {
|
||||
// Something goes here...
|
||||
// panic statement goes here...
|
||||
} else {
|
||||
return Package {
|
||||
Package {
|
||||
sender_country,
|
||||
recipient_country,
|
||||
weight_in_grams,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +31,7 @@ impl Package {
|
||||
}
|
||||
|
||||
fn get_fees(&self, cents_per_gram: i32) -> ??? {
|
||||
// Something goes here...
|
||||
// Something goes here...
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,12 +58,22 @@ mod tests {
|
||||
assert!(package.is_international());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn create_local_package() {
|
||||
let sender_country = String::from("Canada");
|
||||
let recipient_country = sender_country.clone();
|
||||
|
||||
let package = Package::new(sender_country, recipient_country, 1200);
|
||||
|
||||
assert!(!package.is_international());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn calculate_transport_fees() {
|
||||
let sender_country = String::from("Spain");
|
||||
let recipient_country = String::from("Spain");
|
||||
|
||||
let cents_per_gram = ???;
|
||||
let cents_per_gram = 3;
|
||||
|
||||
let package = Package::new(sender_country, recipient_country, 1500);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
### Tests
|
||||
# Tests
|
||||
|
||||
Going out of order from the book to cover tests -- many of the following exercises will ask you to make tests pass!
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Writing Tests](https://doc.rust-lang.org/book/ch11-01-writing-tests.html)
|
||||
|
||||
3
exercises/tests/mod.rs
Normal file
3
exercises/tests/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod tests1;
|
||||
mod tests2;
|
||||
mod tests3;
|
||||
@@ -1 +1,9 @@
|
||||
For this exercise check out the [Dining Philosophers example](https://doc.rust-lang.org/1.4.0/book/dining-philosophers.html) and the chapter [Concurrency](https://doc.rust-lang.org/book/ch16-01-threads.html) of the Rust Book.
|
||||
# Threads
|
||||
|
||||
In most current operating systems, an executed program’s code is run in a process, and the operating system manages multiple processes at once.
|
||||
Within your program, you can also have independent parts that run simultaneously. The features that run these independent parts are called threads.
|
||||
|
||||
## Further information
|
||||
|
||||
- [Dining Philosophers example](https://doc.rust-lang.org/1.4.0/book/dining-philosophers.html)
|
||||
- [Using Threads to Run Code Simultaneously](https://doc.rust-lang.org/book/ch16-01-threads.html)
|
||||
|
||||
1
exercises/threads/mod.rs
Normal file
1
exercises/threads/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
mod threads1;
|
||||
@@ -1,7 +1,8 @@
|
||||
// threads1.rs
|
||||
// Make this compile! Execute `rustlings hint threads1` for hints :)
|
||||
// The idea is the thread spawned on line 21 is completing jobs while the main thread is
|
||||
// monitoring progress until 10 jobs are completed. If you see 6 lines
|
||||
// The idea is the thread spawned on line 22 is completing jobs while the main thread is
|
||||
// monitoring progress until 10 jobs are completed. Because of the difference between the
|
||||
// spawned threads' sleep time, and the waiting threads sleep time, when you see 6 lines
|
||||
// of "waiting..." and the program ends without timing out when running,
|
||||
// you've got it :)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
### Traits
|
||||
# Traits
|
||||
|
||||
A trait is a collection of methods.
|
||||
|
||||
@@ -7,14 +7,13 @@ Data types can implement traits. To do so, the methods making up the trait are d
|
||||
In this way, traits are somewhat similar to Java interfaces and C++ abstract classes.
|
||||
|
||||
Some additional common Rust traits include:
|
||||
|
||||
+ `Clone` (the `clone` method),
|
||||
+ `Display` (which allows formatted display via `{}`), and
|
||||
+ `Debug` (which allows formatted display via `{:?}`).
|
||||
- `Clone` (the `clone` method)
|
||||
- `Display` (which allows formatted display via `{}`)
|
||||
- `Debug` (which allows formatted display via `{:?}`)
|
||||
|
||||
Because traits indicate shared behavior between data types, they are useful when writing generics.
|
||||
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Traits](https://doc.rust-lang.org/book/ch10-02-traits.html)
|
||||
|
||||
2
exercises/traits/mod.rs
Normal file
2
exercises/traits/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod traits1;
|
||||
mod traits2;
|
||||
@@ -29,12 +29,12 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn is_FooBar() {
|
||||
fn is_foo_bar() {
|
||||
assert_eq!(String::from("Foo").append_bar(), String::from("FooBar"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn is_BarBar() {
|
||||
fn is_bar_bar() {
|
||||
assert_eq!(
|
||||
String::from("").append_bar().append_bar(),
|
||||
String::from("BarBar")
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
### Variables
|
||||
# Variables
|
||||
|
||||
Here you'll learn about simple variables.
|
||||
In Rust, variables are immutable by default.
|
||||
When a variable is immutable, once a value is bound to a name, you can’t change that value.
|
||||
You can make them mutable by adding mut in front of the variable name.
|
||||
|
||||
#### Book Sections
|
||||
## Further information
|
||||
|
||||
- [Variables and Mutability](https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html)
|
||||
|
||||
6
exercises/variables/mod.rs
Normal file
6
exercises/variables/mod.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
mod variables1;
|
||||
mod variables2;
|
||||
mod variables3;
|
||||
mod variables4;
|
||||
mod variables5;
|
||||
mod variables6;
|
||||
@@ -1,10 +1,6 @@
|
||||
// variables1.rs
|
||||
// Make me compile! Execute the command `rustlings hint variables1` if you want a hint :)
|
||||
|
||||
// About this `I AM NOT DONE` thing:
|
||||
// We sometimes encourage you to keep trying things on a given exercise,
|
||||
// even after you already figured it out. If you got everything working and
|
||||
// feel ready for the next exercise, remove the `I AM NOT DONE` comment below.
|
||||
// Make me compile!
|
||||
// Execute the command `rustlings hint variables1` if you want a hint :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let number = "T-H-R-E-E";
|
||||
let number = "T-H-R-E-E"; // don't change this line
|
||||
println!("Spell a Number : {}", number);
|
||||
number = 3;
|
||||
println!("Number plus two is : {}", number + 2);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user