diff --git a/.all-contributorsrc b/.all-contributorsrc
index 84b2365e..f2033dcd 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -1,6 +1,6 @@
{
"files": [
- "README.md"
+ "AUTHORS.md"
],
"imageSize": 100,
"commit": false,
@@ -637,6 +637,911 @@
"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"
+ ]
+ },
+ {
+ "login": "rytheo",
+ "name": "Ryan Lowe",
+ "avatar_url": "https://avatars.githubusercontent.com/u/22184325?v=4",
+ "profile": "https://github.com/rytheo",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "cuishuang",
+ "name": "cui fliter",
+ "avatar_url": "https://avatars.githubusercontent.com/u/15921519?v=4",
+ "profile": "http://www.dashen.tech",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "luskwater",
+ "name": "Ron Lusk",
+ "avatar_url": "https://avatars.githubusercontent.com/u/42529?v=4",
+ "profile": "https://github.com/luskwater",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "liby",
+ "name": "Bryan Lee",
+ "avatar_url": "https://avatars.githubusercontent.com/u/38807139?v=4",
+ "profile": "http://liby.github.io/liby/",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "nandajavarma",
+ "name": "Nandaja Varma",
+ "avatar_url": "https://avatars.githubusercontent.com/u/2624550?v=4",
+ "profile": "http://nandaja.space",
+ "contributions": [
+ "doc"
+ ]
+ },
+ {
+ "login": "merelymyself",
+ "name": "pwygab",
+ "avatar_url": "https://avatars.githubusercontent.com/u/88221256?v=4",
+ "profile": "https://github.com/merelymyself",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "lucasgrvarela",
+ "name": "Lucas Grigolon Varela",
+ "avatar_url": "https://avatars.githubusercontent.com/u/37870368?v=4",
+ "profile": "http://linkedin.com/in/lucasgrvarela",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "bufo24",
+ "name": "Bufo",
+ "avatar_url": "https://avatars.githubusercontent.com/u/32884105?v=4",
+ "profile": "https://github.com/bufo24",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "jackos",
+ "name": "Jack Clayton",
+ "avatar_url": "https://avatars.githubusercontent.com/u/77730378?v=4",
+ "profile": "http://rustnote.com",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "klkl0808",
+ "name": "Konstantin",
+ "avatar_url": "https://avatars.githubusercontent.com/u/24694249?v=4",
+ "profile": "https://github.com/klkl0808",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "0pling",
+ "name": "0pling",
+ "avatar_url": "https://avatars.githubusercontent.com/u/104090344?v=4",
+ "profile": "https://github.com/0pling",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "KatanaFluorescent",
+ "name": "KatanaFluorescent",
+ "avatar_url": "https://avatars.githubusercontent.com/u/60199077?v=4",
+ "profile": "https://github.com/KatanaFluorescent",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "Drew-Morris",
+ "name": "Drew Morris",
+ "avatar_url": "https://avatars.githubusercontent.com/u/95818166?v=4",
+ "profile": "https://github.com/Drew-Morris",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "camperdue42",
+ "name": "camperdue42",
+ "avatar_url": "https://avatars.githubusercontent.com/u/43047763?v=4",
+ "profile": "https://github.com/camperdue42",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "YsuOS",
+ "name": "YsuOS",
+ "avatar_url": "https://avatars.githubusercontent.com/u/30138661?v=4",
+ "profile": "https://github.com/YsuOS",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "icecream17",
+ "name": "Steven Nguyen",
+ "avatar_url": "https://avatars.githubusercontent.com/u/58114641?v=4",
+ "profile": "https://lichess.org/@/StevenEmily",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "nacairns1",
+ "name": "nacairns1",
+ "avatar_url": "https://avatars.githubusercontent.com/u/94420090?v=4",
+ "profile": "https://noahcairns.dev",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "pgjbz",
+ "name": "Paulo Gabriel Justino Bezerra",
+ "avatar_url": "https://avatars.githubusercontent.com/u/22059237?v=4",
+ "profile": "https://github.com/pgjbz",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "jaystile",
+ "name": "Jason",
+ "avatar_url": "https://avatars.githubusercontent.com/u/46078028?v=4",
+ "profile": "https://github.com/jaystile",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "exdx",
+ "name": "exdx",
+ "avatar_url": "https://avatars.githubusercontent.com/u/31546601?v=4",
+ "profile": "https://exdx.github.io",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "Jzow",
+ "name": "James Zow",
+ "avatar_url": "https://avatars.githubusercontent.com/u/68860495?v=4",
+ "profile": "https://github.com/Jzow",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "jayber",
+ "name": "James Bromley",
+ "avatar_url": "https://avatars.githubusercontent.com/u/2474334?v=4",
+ "profile": "https://jamesabromley.wordpress.com/",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "swhiteCQC",
+ "name": "swhiteCQC",
+ "avatar_url": "https://avatars.githubusercontent.com/u/77438466?v=4",
+ "profile": "https://github.com/swhiteCQC",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "neilpate",
+ "name": "Neil Pate",
+ "avatar_url": "https://avatars.githubusercontent.com/u/7802334?v=4",
+ "profile": "https://github.com/neilpate",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "wojexe",
+ "name": "wojexe",
+ "avatar_url": "https://avatars.githubusercontent.com/u/21208490?v=4",
+ "profile": "https://wojexe.com",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "Tostapunk",
+ "name": "Mattia Schiavon",
+ "avatar_url": "https://avatars.githubusercontent.com/u/25140297?v=4",
+ "profile": "https://github.com/Tostapunk",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "PrettyWood",
+ "name": "Eric Jolibois",
+ "avatar_url": "https://avatars.githubusercontent.com/u/18406791?v=4",
+ "profile": "http://toucantoco.com",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "EdwinChang24",
+ "name": "Edwin Chang",
+ "avatar_url": "https://avatars.githubusercontent.com/u/88263098?v=4",
+ "profile": "http://edwinchang.vercel.app",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "saikatdas0790",
+ "name": "Saikat Das",
+ "avatar_url": "https://avatars.githubusercontent.com/u/7412443?v=4",
+ "profile": "https://saikat.dev/",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "thatlittleboy",
+ "name": "Jeremy Goh",
+ "avatar_url": "https://avatars.githubusercontent.com/u/30731072?v=4",
+ "profile": "https://github.com/thatlittleboy",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "Lioness100",
+ "name": "Lioness100",
+ "avatar_url": "https://avatars.githubusercontent.com/u/65814829?v=4",
+ "profile": "https://github.com/Lioness100",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "tvkn",
+ "name": "Tristan Nicholls",
+ "avatar_url": "https://avatars.githubusercontent.com/u/79277926?v=4",
+ "profile": "https://github.com/tvkn",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "clairew",
+ "name": "Claire",
+ "avatar_url": "https://avatars.githubusercontent.com/u/9344258?v=4",
+ "profile": "http://clairewang.net",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "Mouwrice",
+ "name": "Maurice Van Wassenhove",
+ "avatar_url": "https://avatars.githubusercontent.com/u/56763273?v=4",
+ "profile": "https://github.com/Mouwrice",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "johnmendel",
+ "name": "John Mendelewski",
+ "avatar_url": "https://avatars.githubusercontent.com/u/77524?v=4",
+ "profile": "http://jmthree.com",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "brianfakhoury",
+ "name": "Brian Fakhoury",
+ "avatar_url": "https://avatars.githubusercontent.com/u/20828724?v=4",
+ "profile": "http://fakhoury.xyz",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "markusboehme",
+ "name": "Markus Boehme",
+ "avatar_url": "https://avatars.githubusercontent.com/u/5074759?v=4",
+ "profile": "https://github.com/markusboehme",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "nico-vromans",
+ "name": "Nico Vromans",
+ "avatar_url": "https://avatars.githubusercontent.com/u/48183857?v=4",
+ "profile": "https://github.com/nico-vromans",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "vostok92",
+ "name": "vostok92",
+ "avatar_url": "https://avatars.githubusercontent.com/u/540339?v=4",
+ "profile": "https://github.com/vostok92",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "magnusrodseth",
+ "name": "Magnus RΓΈdseth",
+ "avatar_url": "https://avatars.githubusercontent.com/u/59113973?v=4",
+ "profile": "http://magnusrodseth.vercel.app",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "rubiesonthesky",
+ "name": "rubiesonthesky",
+ "avatar_url": "https://avatars.githubusercontent.com/u/2591240?v=4",
+ "profile": "https://github.com/rubiesonthesky",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "GabrielBianconi",
+ "name": "Gabriel Bianconi",
+ "avatar_url": "https://avatars.githubusercontent.com/u/1275491?v=4",
+ "profile": "http://www.gabrielbianconi.com/",
+ "contributions": [
+ "content"
+ ]
+ },
+ {
+ "login": "Kodylow",
+ "name": "Kody Low",
+ "avatar_url": "https://avatars.githubusercontent.com/u/74332828?v=4",
+ "profile": "https://github.com/Kodylow",
+ "contributions": [
+ "content"
+ ]
}
],
"contributorsPerLine": 8,
diff --git a/.clog.toml b/.clog.toml
deleted file mode 100644
index 206c3b5a..00000000
--- a/.clog.toml
+++ /dev/null
@@ -1,4 +0,0 @@
-[clog]
-
-repository = "https://github.com/rust-lang/rustlings"
-changelog = "CHANGELOG.md"
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
index 89cf181d..aab09aa3 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -2,6 +2,6 @@ root = true
[*.rs]
end_of_line = lf
-insert_final_newfile = true
+insert_final_newline = true
indent_style = space
indent_size = 4
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
new file mode 100644
index 00000000..bf2a041a
--- /dev/null
+++ b/.github/workflows/rust.yml
@@ -0,0 +1,20 @@
+name: Rustlings Tests
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Build
+ run: cargo build --verbose
+ - name: Run tests
+ run: cargo test --verbose
diff --git a/.gitignore b/.gitignore
index 06de8710..534453bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,5 +5,8 @@ target/
*.pdb
exercises/clippy/Cargo.toml
exercises/clippy/Cargo.lock
+rust-project.json
.idea
.vscode
+*.iml
+*.o
diff --git a/.gitpod.yml b/.gitpod.yml
index 46b1a6a8..73cb802d 100644
--- a/.gitpod.yml
+++ b/.gitpod.yml
@@ -4,4 +4,4 @@ tasks:
vscode:
extensions:
- - rust-lang.rust@0.7.8:CvNqMTgDdt3UXt+6BCDTVg==
+ - rust-lang.rust@0.7.8
diff --git a/AUTHORS.md b/AUTHORS.md
new file mode 100644
index 00000000..8edf09bf
--- /dev/null
+++ b/AUTHORS.md
@@ -0,0 +1,229 @@
+## Authors
+
+This file lists the people that have contributed to this project.
+
+Excluded from this list are @carols10cents and @diannasoreil, the principal
+authors.
+
+
+
+
+
+
+
+
+
+
+
+This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d58d4e6b..0b15cf99 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,338 @@
+
+## 5.2.0 (2022-08-27)
+
+#### Added
+
+- Added a `reset` command
+
+#### Changed
+
+- **options2**: Convert the exercise to use tests
+
+#### Fixed
+
+- **threads3**: Fixed a typo
+- **quiz1**: Adjusted the explanations to be consistent with
+ the tests
+
+
+## 5.1.1 (2022-08-17)
+
+#### Bug Fixes
+
+- Fixed an incorrect assertion in options1
+
+
+## 5.1.0 (2022-08-16)
+
+#### Features
+
+- Added a new `rc1` exercise.
+- Added a new `cow1` exercise.
+
+#### Bug Fixes
+
+- **variables5**: Corrected reference to previous exercise
+- **functions4**: Fixed line number reference
+- **strings3**: Clarified comment wording
+- **traits4, traits5**: Fixed line number reference
+- **traits5**:
+ - Fixed typo in "parameter"
+ - Made exercise prefer a traits-based solution
+- **lifetimes2**: Improved hint
+- **threads3**: Fixed typo in hint
+- **box1**: Replaced `unimplemented!` with `todo!`
+- **errors5**: Provided an explanation for usage of `Box`
+- **quiz2**: Fixed a typo
+- **macros**: Updated the macros book link
+- **options1**:
+ - Removed unused code
+ - Added more granular tests
+- Fixed some comment syntax shenanigans in info.toml
+
+#### Housekeeping
+
+- Fixed a typo in .editorconfig
+- Fixed a typo in integration_tests.rs
+- Clarified manual installation instructions using `cargo install --path .`
+- Added a link to our Zulip in the readme file
+
+
+## 5.0.0 (2022-07-16)
+
+#### Features
+
+- Hint comments in exercises now also include a reference to the
+ `hint` watch mode subcommand.
+- **intro1**: Added more hints to point the user to the source file.
+- **variables**: Switched variables3 and variables4.
+- Moved `vec` and `primitive_types` exercises before `move_semantics`.
+- Renamed `vec` to `vecs` to be more in line with the naming in general.
+- Split up the `collections` exercises in their own folders.
+- **vec2**: Added a second part of the function that provides an alternative,
+ immutable way of modifying vec values.
+- **enums3**: Added a hint.
+- Moved `strings` before `modules`.
+- Added a `strings3` exercise to teach modifying strings.
+- Added a `hashmaps3` exercise for some advanced usage of hashmaps.
+- Moved the original `quiz2` to be `strings4`, since it only tested strings
+ anyways.
+- Reworked `quiz2` into a new exercise that tests more chapters.
+- Renamed `option` to `options`.
+- **options1**: Rewrote parts of the exercise to remove the weird array
+ iteration stuff.
+- Moved `generics3` to be `quiz3`.
+- Moved box/arc exercises behind `iterators`.
+- **iterators4**: Added a test for factorials of zero.
+- Split `threads1` between two exercises, the first one focusing more on
+ `JoinHandle`s.
+- Added a `threads3` exercises that uses `std::sync::mpsc`.
+- Added a `clippy3` exercises with some more interesting checks.
+- **as_ref_mut**: Added a section that actually tests `AsMut`.
+- Added 3 new lifetimes exercises.
+- Added 3 new traits exercises.
+
+#### Bug Fixes
+
+- **variables2**: Made output messages more verbose.
+- **variables5**: Added a nudging hint about shadowing.
+- **variables6**: Fixed link to book.
+- **functions**: Clarified the README wording. Generally cleaned up
+ some hints and added some extra comments.
+- **if2**: Renamed function name to `foo_if_fizz`.
+- **move_semantics**: Clarified some hints.
+- **quiz1**: Renamed the function name to be more verbose.
+- **structs1**: Use an integer type instead of strings. Renamed "unit structs"
+ to "unit-like structs", as is used in the book.
+- **structs3**: Added the `panic!` statement in from the beginning.
+- **errors1**: Use `is_empty()` instead of `len() > 0`
+- **errors3**: Improved the hint.
+- **errors5**: Improved exercise instructions and the hint.
+- **errors6**: Provided the skeleton of one of the functions that's supposed
+ to be implemented.
+- **iterators3**: Inserted `todo!` into `divide()` to keep a compiler error
+ from happening.
+- **from_str**: Added a hint comment about string error message conversion with
+ `Box`.
+- **try_from_into**: Fixed the function name in comment.
+
+#### Removed
+
+- Removed the legacy LSP feature that was using `mod.rs` files.
+- Removed `quiz4`.
+- Removed `advanced_errs`. These were the last exercises in the recommended
+ order, and I've always felt like they didn't quite fit in with the mostly
+ simple, book-following style we've had in Rustlings.
+
+#### Housekeeping
+
+- Added missing exercises to the book index.
+- Updated spacing in Cargo.toml.
+- Added a GitHub actions config so that tests run on every PR/commit.
+
+
+## 4.8.0 (2022-07-01)
+
+#### Features
+
+- Added a progress indicator for `rustlings watch`.
+- The installation script now checks for Rustup being installed.
+- Added a `rustlings lsp` command to enable `rust-analyzer`.
+
+#### Bug Fixes
+
+- **move_semantics5**: Replaced "in vogue" with "in scope" in hint.
+- **if2**: Fixed a typo in the hint.
+- **variables1**: Fixed an incorrect line reference in the hint.
+- Fixed an out of bounds check in the installation Bash script.
+
+#### Housekeeping
+
+- Replaced the git.io URL with the fully qualified URL because of git.io's sunsetting.
+- Removed the deprecated Rust GitPod extension.
+
+
+## 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.
+
+
+## 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))
+
+
+
+## 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))
+
+
+
+
+## 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))
+
+
+
+
+## 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))
+
+
+
+
+## 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))
+
## 4.2.0 (2020-11-07)
@@ -103,7 +438,7 @@
#### Features
* add Option2 exercise (#290) ([86b5c08b](https://github.com/rust-lang/rustlings/commit/86b5c08b9bea1576127a7c5f599f5752072c087d))
-* add excercise for option (#282) ([135e5d47](https://github.com/rust-lang/rustlings/commit/135e5d47a7c395aece6f6022117fb20c82f2d3d4))
+* add exercise for option (#282) ([135e5d47](https://github.com/rust-lang/rustlings/commit/135e5d47a7c395aece6f6022117fb20c82f2d3d4))
* add new exercises for generics (#280) ([76be5e4e](https://github.com/rust-lang/rustlings/commit/76be5e4e991160f5fd9093f03ee2ba260e8f7229))
* **ci:** add buildkite config ([b049fa2c](https://github.com/rust-lang/rustlings/commit/b049fa2c84dba0f0c8906ac44e28fd45fba51a71))
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d566df08..cc8ac923 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -21,17 +21,17 @@ _implement a new feature! β‘οΈ [open an Issue to discuss it first, then a Pull
`rustlings` is basically a glorified `rustc` wrapper. Therefore the source code
isn't really that complicated since the bulk of the work is done by `rustc`.
-`src/main.rs` contains a simple `clap` CLI that loads from `src/verify.rs` and `src/run.rs`.
+`src/main.rs` contains a simple `argh` CLI that connects to most of the other source files.
### 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` and `rustlings watch`.
-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]]
@@ -43,7 +43,7 @@ You want to make sure where in the file you add your exercise. If you're not sur
...
```
-The `mode` attribute decides whether Rustlings will only compile your exercise, or compile and test it. If you have tests to verify in your exercise, choose `test`, otherwise `compile`.
+The `mode` attribute decides whether Rustlings will only compile your exercise, or compile and test it. If you have tests to verify in your exercise, choose `test`, otherwise `compile`. If you're working on a Clippy exercise, use `mode = "clippy"`.
That's all! Feel free to put up a pull request.
@@ -67,19 +67,19 @@ changes. There's a couple of things to watch out for:
#### Write correct commit messages
We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
-specification, because it makes it easier to generate changelogs automatically.
+specification.
This means that you have to format your commit messages in a specific way. Say
you're working on adding a new exercise called `foobar1.rs`. You could write
the following commit message:
```
-feat: Add foobar1.rs exercise
+feat: add foobar1.rs exercise
```
If you're just fixing a bug, please use the `fix` type:
```
-fix(verify): Make sure verify doesn't self-destruct
+fix(verify): make sure verify doesn't self-destruct
```
The scope within the brackets is optional, but should be any of these:
@@ -96,7 +96,7 @@ When the commit also happens to close an existing issue, link it in the message
body:
```
-fix: Update foobar
+fix: update foobar
closes #101029908
```
@@ -104,13 +104,13 @@ closes #101029908
If you're doing simple changes, like updating a book link, use `chore`:
```
-chore: Update exercise1.rs book link
+chore: update exercise1.rs book link
```
If you're updating documentation, use `docs`:
```
-docs: Add more information to Readme
+docs: add more information to Readme
```
If, and only if, you're absolutely sure you want to make a breaking change
@@ -118,7 +118,7 @@ If, and only if, you're absolutely sure you want to make a breaking change
explain the breaking change in the message body:
```
-fix!: Completely change verification
+fix!: completely change verification
BREAKING CHANGE: This has to be done because lorem ipsum dolor
```
@@ -126,6 +126,5 @@ BREAKING CHANGE: This has to be done because lorem ipsum dolor
#### Pull Request Workflow
Once you open a Pull Request, it may be reviewed or labeled (or both) until
-the maintainers accept your change. Then, [bors](https://github.com/bors) will
-run the test suite with your changes and if it's successful, automatically
-merge it in!
+the maintainers accept your change. Please be patient, it may take some time
+for this to happen!
diff --git a/Cargo.lock b/Cargo.lock
index 9f90e0a1..2370e8dc 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,920 +1,646 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "aho-corasick"
-version = "0.7.3"
+version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [
- "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "memchr",
]
[[package]]
-name = "ansi_term"
-version = "0.11.0"
+name = "argh"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e7317a549bc17c5278d9e72bb6e62c6aa801ac2567048e39ebc1c194249323e"
dependencies = [
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "argh_derive",
+ "argh_shared",
]
+[[package]]
+name = "argh_derive"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60949c42375351e9442e354434b0cba2ac402c1237edf673cac3a4bf983b8d3c"
+dependencies = [
+ "argh_shared",
+ "heck",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "argh_shared"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a61eb019cb8f415d162cb9f12130ee6bbe9168b7d953c17f4ad049e4051ca00"
+
[[package]]
name = "assert_cmd"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dc477793bd82ec39799b6f6b3df64938532fdf2ab0d49ef817eac65856a5a1e"
dependencies = [
- "escargot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "atty"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "escargot",
+ "predicates",
+ "predicates-core",
+ "predicates-tree",
]
[[package]]
name = "autocfg"
-version = "0.1.4"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "bitflags"
-version = "1.0.4"
+version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "cfg-if"
-version = "0.1.9"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
-name = "clap"
-version = "2.33.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "clicolors-control"
+name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "console"
-version = "0.7.7"
+version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31"
dependencies = [
- "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "console"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encode_unicode",
+ "libc",
+ "once_cell",
+ "regex",
+ "terminal_size",
+ "unicode-width",
+ "winapi 0.3.9",
]
[[package]]
name = "difference"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
[[package]]
name = "encode_unicode"
-version = "0.3.5"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
[[package]]
name = "escargot"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ceb9adbf9874d5d028b5e4c5739d22b71988252b25c9c98fe7cf9738bee84597"
dependencies = [
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static",
+ "log",
+ "serde",
+ "serde_json",
]
[[package]]
name = "filetime"
-version = "0.2.5"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"
dependencies = [
- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 1.0.0",
+ "libc",
+ "redox_syscall",
+ "winapi 0.3.9",
]
[[package]]
name = "float-cmp"
-version = "0.4.0"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4"
dependencies = [
- "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits",
]
[[package]]
name = "fsevent"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6"
dependencies = [
- "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags",
+ "fsevent-sys",
]
[[package]]
name = "fsevent-sys"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0"
dependencies = [
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc",
]
-[[package]]
-name = "fuchsia-cprng"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
dependencies = [
- "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags",
+ "fuchsia-zircon-sys",
]
[[package]]
name = "fuchsia-zircon-sys"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
name = "glob"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
+
+[[package]]
+name = "heck"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
+dependencies = [
+ "unicode-segmentation",
+]
+
+[[package]]
+name = "home"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
+dependencies = [
+ "winapi 0.3.9",
+]
[[package]]
name = "indicatif"
-version = "0.10.3"
+version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b"
dependencies = [
- "console 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "console",
+ "lazy_static",
+ "number_prefix",
+ "regex",
]
[[package]]
name = "inotify"
-version = "0.7.0"
+version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f"
dependencies = [
- "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags",
+ "inotify-sys",
+ "libc",
]
[[package]]
name = "inotify-sys"
-version = "0.1.3"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb"
dependencies = [
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc",
]
[[package]]
name = "iovec"
-version = "0.1.2"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
dependencies = [
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc",
]
[[package]]
name = "itoa"
-version = "0.4.4"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.8",
+ "winapi-build",
]
[[package]]
name = "lazy_static"
-version = "1.3.0"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "lazycell"
-version = "1.2.1"
+version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
-version = "0.2.58"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "lock_api"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
+checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5"
[[package]]
name = "log"
-version = "0.4.6"
+version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 1.0.0",
]
[[package]]
name = "memchr"
-version = "2.2.0"
+version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "mio"
-version = "0.6.19"
+version = "0.6.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4"
dependencies = [
- "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.10",
+ "fuchsia-zircon",
+ "fuchsia-zircon-sys",
+ "iovec",
+ "kernel32-sys",
+ "libc",
+ "log",
+ "miow",
+ "net2",
+ "slab",
+ "winapi 0.2.8",
]
[[package]]
name = "mio-extras"
-version = "2.0.5"
+version = "2.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19"
dependencies = [
- "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazycell",
+ "log",
+ "mio",
+ "slab",
]
[[package]]
name = "miow"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d"
dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "kernel32-sys",
+ "net2",
+ "winapi 0.2.8",
+ "ws2_32-sys",
]
[[package]]
name = "net2"
-version = "0.2.33"
+version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae"
dependencies = [
- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.10",
+ "libc",
+ "winapi 0.3.9",
]
[[package]]
name = "normalize-line-endings"
-version = "0.2.2"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
[[package]]
name = "notify"
-version = "4.0.15"
+version = "4.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257"
dependencies = [
- "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "filetime 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "fsevent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "inotify 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)",
- "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags",
+ "filetime",
+ "fsevent",
+ "fsevent-sys",
+ "inotify",
+ "libc",
+ "mio",
+ "mio-extras",
+ "walkdir",
+ "winapi 0.3.9",
]
[[package]]
name = "num-traits"
-version = "0.2.8"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
dependencies = [
- "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "autocfg",
]
[[package]]
name = "number_prefix"
-version = "0.2.8"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
+checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]]
-name = "numtoa"
-version = "0.1.0"
+name = "once_cell"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "parking_lot"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "lock_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
+checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
[[package]]
name = "predicates"
-version = "1.0.1"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df"
dependencies = [
- "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "difference",
+ "float-cmp",
+ "normalize-line-endings",
+ "predicates-core",
+ "regex",
]
[[package]]
name = "predicates-core"
-version = "1.0.0"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57e35a3326b75e49aa85f5dc6ec15b41108cf5aee58eabb1f274dd18b73c2451"
[[package]]
name = "predicates-tree"
-version = "1.0.0"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d7dd0fd014130206c9352efbdc92be592751b2b9274dff685348341082c6ea3d"
dependencies = [
- "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "predicates-core",
+ "treeline",
]
[[package]]
name = "proc-macro2"
-version = "0.4.30"
+version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
dependencies = [
- "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-xid",
]
[[package]]
name = "quote"
-version = "0.6.12"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
dependencies = [
- "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "rand_hc"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand_isaac"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand_jitter"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand_os"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand_pcg"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand_xorshift"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rdrand"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2",
]
[[package]]
name = "redox_syscall"
-version = "0.1.54"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "redox_termios"
-version = "0.1.1"
+version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
dependencies = [
- "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags",
]
[[package]]
name = "regex"
-version = "1.1.6"
+version = "1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
dependencies = [
- "aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
]
[[package]]
name = "regex-syntax"
-version = "0.6.6"
+version = "0.6.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc_version"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
+checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
name = "rustlings"
-version = "4.2.0"
+version = "5.1.1"
dependencies = [
- "assert_cmd 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "indicatif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "argh",
+ "assert_cmd",
+ "console",
+ "glob",
+ "home",
+ "indicatif",
+ "notify",
+ "predicates",
+ "regex",
+ "serde",
+ "serde_json",
+ "toml",
]
[[package]]
name = "ryu"
-version = "0.2.8"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
[[package]]
name = "same-file"
-version = "1.0.4"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
dependencies = [
- "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi-util",
]
-[[package]]
-name = "scopeguard"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "semver"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "semver-parser"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "serde"
-version = "1.0.92"
+version = "1.0.129"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1f72836d2aa753853178eda473a3b9d8e4eefdaf20523b919677e6de489f8f1"
dependencies = [
- "serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.92"
+version = "1.0.129"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e57ae87ad533d9a56427558b516d0adac283614e347abf85b0dc0cbbf0a249f3"
dependencies = [
- "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
name = "serde_json"
-version = "1.0.39"
+version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c"
dependencies = [
- "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
+ "itoa",
+ "ryu",
+ "serde",
]
[[package]]
name = "slab"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "smallvec"
-version = "0.6.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "strsim"
-version = "0.8.0"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
[[package]]
name = "syn"
-version = "0.15.34"
+version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7"
dependencies = [
- "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2",
+ "quote",
+ "unicode-xid",
]
[[package]]
-name = "termion"
-version = "1.5.2"
+name = "terminal_size"
+version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
dependencies = [
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "termios"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "thread_local"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc",
+ "winapi 0.3.9",
]
[[package]]
name = "toml"
-version = "0.4.10"
+version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
dependencies = [
- "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde",
]
[[package]]
name = "treeline"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41"
[[package]]
-name = "ucd-util"
-version = "0.1.3"
+name = "unicode-segmentation"
+version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
[[package]]
name = "unicode-width"
-version = "0.1.5"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
[[package]]
name = "unicode-xid"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "utf8-ranges"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "vec_map"
-version = "0.8.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "walkdir"
-version = "2.2.7"
+version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
dependencies = [
- "same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "same-file",
+ "winapi 0.3.9",
+ "winapi-util",
]
[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
[[package]]
name = "winapi"
-version = "0.3.8"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
- "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
-version = "0.1.2"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.9",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "ws2_32-sys"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.8",
+ "winapi-build",
]
-
-[metadata]
-"checksum aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6f484ae0c99fec2e858eb6134949117399f222608d84cadb3f58c1f97c2364c"
-"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
-"checksum assert_cmd 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2dc477793bd82ec39799b6f6b3df64938532fdf2ab0d49ef817eac65856a5a1e"
-"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
-"checksum autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0e49efa51329a5fd37e7c79db4621af617cd4e3e5bc224939808d076077077bf"
-"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
-"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"
-"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
-"checksum clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "73abfd4c73d003a674ce5d2933fca6ce6c42480ea84a5ffe0a2dc39ed56300f9"
-"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
-"checksum console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8ca57c2c14b8a2bf3105bc9d15574aad80babf6a9c44b1058034cdf8bd169628"
-"checksum console 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b147390a412132d75d10dd3b7b175a69cf5fd95032f7503c7091b8831ba10242"
-"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
-"checksum encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "90b2c9496c001e8cb61827acdefad780795c42264c137744cae6f7d9e3450abd"
-"checksum escargot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ceb9adbf9874d5d028b5e4c5739d22b71988252b25c9c98fe7cf9738bee84597"
-"checksum filetime 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2f8c63033fcba1f51ef744505b3cad42510432b904c062afa67ad7ece008429d"
-"checksum float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "134a8fa843d80a51a5b77d36d42bc2def9edcb0262c914861d08129fd1926600"
-"checksum fsevent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6"
-"checksum fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0"
-"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
-"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
-"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
-"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
-"checksum indicatif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "40ecd1e2ee08e6c255ce890f5a99d17000850e664e7acf119fb03b25b0575bfe"
-"checksum inotify 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24e40d6fd5d64e2082e0c796495c8ef5ad667a96d03e5aaa0becfd9d47bcbfb8"
-"checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0"
-"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
-"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"
-"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
-"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
-"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
-"checksum libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "6281b86796ba5e4366000be6e9e18bf35580adf9e63fbe2294aadb587613a319"
-"checksum lock_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff"
-"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
-"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
-"checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23"
-"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40"
-"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
-"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
-"checksum normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2e0a1a39eab95caf4f5556da9289b9e68f0aafac901b2ce80daaf020d3b733a8"
-"checksum notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd"
-"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32"
-"checksum number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee"
-"checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef"
-"checksum parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa7767817701cce701d5585b9c4db3cdd02086398322c1d7e8bf5094a96a2ce7"
-"checksum parking_lot_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb88cb1cb3790baa6776844f968fea3be44956cf184fa1be5a03341f5491278c"
-"checksum predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "53e09015b0d3f5a0ec2d4428f7559bb7b3fff341b4e159fedd1d57fac8b939ff"
-"checksum predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178"
-"checksum predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124"
-"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
-"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db"
-"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
-"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
-"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
-"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
-"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
-"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
-"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"
-"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
-"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
-"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
-"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
-"checksum redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)" = "12229c14a0f65c4f1cb046a3b52047cdd9da1f4b30f8a39c5063c8bae515e252"
-"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
-"checksum regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8f0a0bcab2fd7d1d7c54fa9eae6f43eddeb9ce2e7352f8518a814a4f65d60c58"
-"checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96"
-"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
-"checksum ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "b96a9549dc8d48f2c283938303c4b5a77aa29bfbc5b54b084fb1630408899a8f"
-"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
-"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d"
-"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
-"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
-"checksum serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)" = "32746bf0f26eab52f06af0d0aa1984f641341d06d8d673c693871da2d188c9be"
-"checksum serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)" = "46a3223d0c9ba936b61c0d2e3e559e3217dbfb8d65d06d26e8b3c25de38bae3e"
-"checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d"
-"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
-"checksum smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c4488ae950c49d403731982257768f48fada354a5203fe81f9bb6f43ca9002be"
-"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
-"checksum syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)" = "a1393e4a97a19c01e900df2aec855a29f71cf02c402e2f443b8d2747c25c5dbe"
-"checksum termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dde0593aeb8d47accea5392b39350015b5eccb12c0d98044d856983d89548dea"
-"checksum termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625"
-"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
-"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
-"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
-"checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41"
-"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86"
-"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
-"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
-"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
-"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
-"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
-"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
-"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
-"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
-"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9"
-"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
diff --git a/Cargo.toml b/Cargo.toml
index ebce25eb..25cd7bfe 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,17 +1,20 @@
[package]
name = "rustlings"
-version = "4.2.0"
-authors = ["Marisa ", "Carol (Nichols || Goulding) "]
-edition = "2018"
+version = "5.2.0"
+authors = ["Liv ", "Carol (Nichols || Goulding) "]
+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"] }
+serde_json = "1.0.81"
+home = "0.5.3"
+glob = "0.3.0"
[[bin]]
name = "rustlings"
diff --git a/README.md b/README.md
index fd45d945..2392ba9d 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,3 @@
-
-
-[](#contributors-)
-
-
# 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,47 +21,50 @@ 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://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | 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://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | 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://raw.githubusercontent.com/rust-lang/rustlings/main/install.ps1 -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.
-## Browser:
+If you get a permission denied message, you might have to exclude the directory where you cloned Rustlings in your antivirus.
+
+## Browser
[Run on Repl.it](https://repl.it/github/rust-lang/rustlings)
-[Open in Gitpod](https://gitpod.io/#https://github.com/rust-lang/rustlings)
+[](https://gitpod.io/#https://github.com/rust-lang/rustlings)
## Manually
-Basically: Clone the repository, checkout to the latest tag, run `cargo install`.
+Basically: Clone the repository at the latest tag, run `cargo install --path .`.
```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 5.1.1)
+git clone -b 5.1.1 --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,148 +95,69 @@ 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`
+
+Run the command `rustlings lsp` which will generate a `rust-project.json` at the root of the project, this allows [rust-analyzer](https://rust-analyzer.github.io/) to parse each exercise.
+
## 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
```
-## Completion
-
-Rustlings isn't done; there are a couple of sections that are very experimental and don't have proper documentation. These include:
-
-- Errors (`exercises/errors/`)
-- Option (`exercises/option/`)
-- Result (`exercises/result/`)
-- Move Semantics (could still be improved, `exercises/move_semantics/`)
-
-Additionally, we could use exercises on a couple of topics:
-
-- Structs
-- Better ownership stuff
-- `impl`
-- ??? probably more
-
-If you are interested in improving or adding new ones, please feel free to contribute! Read on for more information :)
+Now you should be done!
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md).
+Development-focused discussion about Rustlings happens in the [**rustlings** stream](https://rust-lang.zulipchat.com/#narrow/stream/334454-rustlings)
+on the [Rust Project Zulip](https://rust-lang.zulipchat.com). Feel free to start a new thread there
+if you have ideas or suggestions!
+
## Contributors β¨
-Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
-
-
-
-
-
-
-
-
-
-
-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) π
diff --git a/default_out.txt b/default_out.txt
deleted file mode 100644
index 05267591..00000000
--- a/default_out.txt
+++ /dev/null
@@ -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!
diff --git a/exercises/README.md b/exercises/README.md
new file mode 100644
index 00000000..e52137ca
--- /dev/null
+++ b/exercises/README.md
@@ -0,0 +1,26 @@
+# Exercise to Book Chapter mapping
+
+| Exercise | Book Chapter |
+| ---------------------- | ------------------- |
+| variables | Β§3.1 |
+| functions | Β§3.3 |
+| if | Β§3.5 |
+| primitive_types | Β§3.2, Β§4.3 |
+| vecs | Β§8.1 |
+| move_semantics | Β§4.1, Β§4.2 |
+| structs | Β§5.1, Β§5.3 |
+| enums | Β§6, Β§18.3 |
+| strings | Β§8.2 |
+| modules | Β§7 |
+| hashmaps | Β§8.3 |
+| options | Β§10.1 |
+| error_handling | Β§9 |
+| generics | Β§10 |
+| traits | Β§10.2 |
+| tests | Β§11.1 |
+| lifetimes | Β§10.3 |
+| standard_library_types | Β§13.2, Β§15.1, Β§16.3 |
+| threads | Β§16.1, Β§16.2, Β§16.3 |
+| macros | Β§19.6 |
+| clippy | n/a |
+| conversions | n/a |
diff --git a/exercises/clippy/README.md b/exercises/clippy/README.md
index 60a12fe5..55438af6 100644
--- a/exercises/clippy/README.md
+++ b/exercises/clippy/README.md
@@ -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).
diff --git a/exercises/clippy/clippy1.rs b/exercises/clippy/clippy1.rs
index bdb5dd2c..bad46891 100644
--- a/exercises/clippy/clippy1.rs
+++ b/exercises/clippy/clippy1.rs
@@ -4,14 +4,20 @@
//
// For these exercises the code will fail to compile when there are clippy warnings
// check clippy's suggestions from the output to solve the exercise.
-// Execute `rustlings hint clippy1` for hints :)
+// Execute `rustlings hint clippy1` or use the `hint` watch subcommand for a hint.
// 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
+ )
}
diff --git a/exercises/clippy/clippy2.rs b/exercises/clippy/clippy2.rs
index 37af9ed0..dac40dbe 100644
--- a/exercises/clippy/clippy2.rs
+++ b/exercises/clippy/clippy2.rs
@@ -1,5 +1,5 @@
// clippy2.rs
-// Make me compile! Execute `rustlings hint clippy2` for hints :)
+// Execute `rustlings hint clippy2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/clippy/clippy3.rs b/exercises/clippy/clippy3.rs
new file mode 100644
index 00000000..b0159ebe
--- /dev/null
+++ b/exercises/clippy/clippy3.rs
@@ -0,0 +1,28 @@
+// clippy3.rs
+// Here's a couple more easy Clippy fixes, so you can see its utility.
+
+// I AM NOT DONE
+
+#[allow(unused_variables, unused_assignments)]
+fn main() {
+ let my_option: Option<()> = None;
+ if my_option.is_none() {
+ my_option.unwrap();
+ }
+
+ let my_arr = &[
+ -1, -2, -3
+ -4, -5, -6
+ ];
+ println!("My array! Here it is: {:?}", my_arr);
+
+ let my_empty_vec = vec![1, 2, 3, 4, 5].resize(0, 5);
+ println!("This Vec is empty, see? {:?}", my_empty_vec);
+
+ let mut value_a = 45;
+ let mut value_b = 66;
+ // Let's swap these two!
+ value_a = value_b;
+ value_b = value_a;
+ println!("value a: {}; value b: {}", value_a, value_b);
+}
diff --git a/exercises/collections/README.md b/exercises/collections/README.md
deleted file mode 100644
index 9ded29a0..00000000
--- a/exercises/collections/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-### Collections
-
-Rustβs standard library includes a number of very useful data
-structures called collections. Most other data types represent one
-specific value, but collections can contain multiple values. Unlike
-the built-in array and tuple types, the data these collections point
-to is stored on the heap, which means the amount of data does not need
-to be known at compile time and can grow or shrink as the program
-runs.
-
-This exercise will get you familiar with two fundamental data
-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.
-
-[Rust book chapter](https://doc.rust-lang.org/stable/book/ch08-01-vectors.html)
diff --git a/exercises/conversions/README.md b/exercises/conversions/README.md
index 114bd428..8d7da93e 100644
--- a/exercises/conversions/README.md
+++ b/exercises/conversions/README.md
@@ -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).
\ No newline at end of file
+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)
\ No newline at end of file
diff --git a/exercises/conversions/as_ref_mut.rs b/exercises/conversions/as_ref_mut.rs
index 84f4a60c..9f479739 100644
--- a/exercises/conversions/as_ref_mut.rs
+++ b/exercises/conversions/as_ref_mut.rs
@@ -1,6 +1,7 @@
// AsRef and AsMut allow for cheap reference-to-reference conversions.
// Read more about them at https://doc.rust-lang.org/std/convert/trait.AsRef.html
// and https://doc.rust-lang.org/std/convert/trait.AsMut.html, respectively.
+// Execute `rustlings hint as_ref_mut` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
@@ -16,10 +17,10 @@ fn char_counter(arg: T) -> usize {
arg.as_ref().chars().count()
}
-fn main() {
- let s = "CafΓ© au lait";
- println!("{}", char_counter(s));
- println!("{}", byte_counter(s));
+// Squares a number using AsMut. Add the trait bound as is appropriate and
+// implement the function body.
+fn num_sq(arg: &mut T) {
+ ???
}
#[cfg(test)]
@@ -49,4 +50,11 @@ mod tests {
let s = String::from("Cafe au lait");
assert_eq!(char_counter(s.clone()), byte_counter(s));
}
+
+ #[test]
+ fn mult_box() {
+ let mut num: Box = Box::new(3);
+ num_sq(&mut num);
+ assert_eq!(*num, 9);
+ }
}
diff --git a/exercises/conversions/from_into.rs b/exercises/conversions/from_into.rs
index f24cf61b..6c272c3b 100644
--- a/exercises/conversions/from_into.rs
+++ b/exercises/conversions/from_into.rs
@@ -1,6 +1,8 @@
// The From trait is used for value-to-value conversions.
// If From is implemented correctly for a type, the Into trait should work conversely.
// You can read more about it at https://doc.rust-lang.org/std/convert/trait.From.html
+// Execute `rustlings hint from_into` or use the `hint` watch subcommand for a hint.
+
#[derive(Debug)]
struct Person {
name: String,
@@ -115,4 +117,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);
+ }
}
diff --git a/exercises/conversions/from_str.rs b/exercises/conversions/from_str.rs
index af9eee6d..fe168159 100644
--- a/exercises/conversions/from_str.rs
+++ b/exercises/conversions/from_str.rs
@@ -1,27 +1,50 @@
-// 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
+// Execute `rustlings hint from_str` or use the `hint` watch subcommand for a hint.
+
+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::()
+ 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::()`.
-// 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::()`
+// 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
+//
+// As an aside: `Box` implements `From<&'_ str>`. This means that if you want to return a
+// string error message, you can do so via just using return `Err("my error message".into())`.
+
impl FromStr for Person {
- type Err = String;
+ type Err = ParsePersonError;
fn from_str(s: &str) -> Result {
}
}
@@ -37,7 +60,7 @@ mod tests {
#[test]
fn empty_input() {
- assert!("".parse::().is_err());
+ assert_eq!("".parse::(), Err(ParsePersonError::Empty));
}
#[test]
fn good_input() {
@@ -48,38 +71,57 @@ mod tests {
assert_eq!(p.age, 32);
}
#[test]
- #[should_panic]
fn missing_age() {
- "John,".parse::().unwrap();
+ assert!(matches!(
+ "John,".parse::(),
+ Err(ParsePersonError::ParseInt(_))
+ ));
}
#[test]
- #[should_panic]
fn invalid_age() {
- "John,twenty".parse::().unwrap();
+ assert!(matches!(
+ "John,twenty".parse::(),
+ Err(ParsePersonError::ParseInt(_))
+ ));
}
#[test]
- #[should_panic]
fn missing_comma_and_age() {
- "John".parse::().unwrap();
+ assert_eq!("John".parse::(), Err(ParsePersonError::BadLen));
}
#[test]
- #[should_panic]
fn missing_name() {
- ",1".parse::().unwrap();
+ assert_eq!(",1".parse::(), Err(ParsePersonError::NoName));
}
#[test]
- #[should_panic]
fn missing_name_and_age() {
- ",".parse::().unwrap();
+ assert!(matches!(
+ ",".parse::(),
+ Err(ParsePersonError::NoName | ParsePersonError::ParseInt(_))
+ ));
}
#[test]
- #[should_panic]
fn missing_name_and_invalid_age() {
- ",one".parse::().unwrap();
+ assert!(matches!(
+ ",one".parse::(),
+ Err(ParsePersonError::NoName | ParsePersonError::ParseInt(_))
+ ));
+ }
+
+ #[test]
+ fn trailing_comma() {
+ assert_eq!("John,32,".parse::(), Err(ParsePersonError::BadLen));
+ }
+
+ #[test]
+ fn trailing_comma_and_some_string() {
+ assert_eq!(
+ "John,32,man".parse::(),
+ Err(ParsePersonError::BadLen)
+ );
}
}
diff --git a/exercises/conversions/try_from_into.rs b/exercises/conversions/try_from_into.rs
index 897b364e..fa98bc90 100644
--- a/exercises/conversions/try_from_into.rs
+++ b/exercises/conversions/try_from_into.rs
@@ -1,7 +1,10 @@
+// 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.
// You can read more about it at https://doc.rust-lang.org/std/convert/trait.TryFrom.html
+// Execute `rustlings hint try_from_into` or use the `hint` watch subcommand for a hint.
+
use std::convert::{TryFrom, TryInto};
#[derive(Debug, PartialEq)]
@@ -11,12 +14,21 @@ 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 to create an implementation for a tuple of three integers,
-// an array of three integers and a slice of integers.
+// an array of three integers, and a slice of integers.
//
// Note that the implementation for tuple and array will be checked at compile time,
// but the slice implementation needs to check the slice length!
@@ -24,36 +36,39 @@ struct Color {
// Tuple implementation
impl TryFrom<(i16, i16, i16)> for Color {
- type Error = String;
- fn try_from(tuple: (i16, i16, i16)) -> Result {}
+ type Error = IntoColorError;
+ fn try_from(tuple: (i16, i16, i16)) -> Result {
+ }
}
// Array implementation
impl TryFrom<[i16; 3]> for Color {
- type Error = String;
- fn try_from(arr: [i16; 3]) -> Result {}
+ type Error = IntoColorError;
+ fn try_from(arr: [i16; 3]) -> Result {
+ }
}
// Slice implementation
impl TryFrom<&[i16]> for Color {
- type Error = String;
- fn try_from(slice: &[i16]) -> Result {}
+ type Error = IntoColorError;
+ fn try_from(slice: &[i16]) -> Result {
+ }
}
fn main() {
- // Use the `from` function
+ // Use the `try_from` function
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 = [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 = (&v[..]).try_into();
println!("{:?}", c4);
}
@@ -64,92 +79,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 = (183, 65, 14).try_into();
+ let c: Result = (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: Result = [1000, 10000, 256].try_into();
- assert!(c.is_err());
+ let c: Result = [1000, 10000, 256].try_into();
+ assert_eq!(c, Err(IntoColorError::IntConversion));
}
#[test]
fn test_array_out_of_range_negative() {
- let c: Result = [-10, -256, -1].try_into();
- assert!(c.is_err());
+ let c: Result = [-10, -256, -1].try_into();
+ assert_eq!(c, Err(IntoColorError::IntConversion));
}
#[test]
fn test_array_sum() {
- let c: Result = [-1, 255, 255].try_into();
- assert!(c.is_err());
+ let c: Result = [-1, 255, 255].try_into();
+ assert_eq!(c, Err(IntoColorError::IntConversion));
}
#[test]
- #[test]
fn test_array_correct() {
- let c: Result = [183, 65, 14].try_into();
+ let c: Result = [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::try_from(&v[..]);
+ let c: Result = 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));
}
}
diff --git a/exercises/conversions/using_as.rs b/exercises/conversions/using_as.rs
index 821309ec..8c9b7113 100644
--- a/exercises/conversions/using_as.rs
+++ b/exercises/conversions/using_as.rs
@@ -4,11 +4,12 @@
//
// The goal is to make sure that the division does not fail to compile
// and returns the proper type.
+// Execute `rustlings hint using_as` or use the `hint` watch subcommand for a hint.
// 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::();
total / values.len()
}
diff --git a/exercises/enums/README.md b/exercises/enums/README.md
index 091f5d04..30d4d91d 100644
--- a/exercises/enums/README.md
+++ b/exercises/enums/README.md
@@ -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)
diff --git a/exercises/enums/enums1.rs b/exercises/enums/enums1.rs
index a2223d33..511ba740 100644
--- a/exercises/enums/enums1.rs
+++ b/exercises/enums/enums1.rs
@@ -1,5 +1,5 @@
// enums1.rs
-// Make me compile! Execute `rustlings hint enums1` for hints!
+// No hints this time! ;)
// I AM NOT DONE
diff --git a/exercises/enums/enums2.rs b/exercises/enums/enums2.rs
index ec32d952..18479f87 100644
--- a/exercises/enums/enums2.rs
+++ b/exercises/enums/enums2.rs
@@ -1,5 +1,5 @@
// enums2.rs
-// Make me compile! Execute `rustlings hint enums2` for hints!
+// Execute `rustlings hint enums2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/enums/enums3.rs b/exercises/enums/enums3.rs
index 178b40c4..55acf6bc 100644
--- a/exercises/enums/enums3.rs
+++ b/exercises/enums/enums3.rs
@@ -1,5 +1,6 @@
// enums3.rs
// Address all the TODOs to make the tests pass!
+// Execute `rustlings hint enums3` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/error_handling/README.md b/exercises/error_handling/README.md
index 77a58d18..5255ace9 100644
--- a/exercises/error_handling/README.md
+++ b/exercises/error_handling/README.md
@@ -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)
diff --git a/exercises/error_handling/errors1.rs b/exercises/error_handling/errors1.rs
index 9c24d85d..bcee9723 100644
--- a/exercises/error_handling/errors1.rs
+++ b/exercises/error_handling/errors1.rs
@@ -1,19 +1,18 @@
// 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.
-// Execute `rustlings hint errors1` for hints!
+// 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` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
pub fn generate_nametag_text(name: String) -> Option {
- if name.len() > 0 {
- Some(format!("Hi! My name is {}", name))
- } else {
+ if name.is_empty() {
// Empty names aren't allowed.
None
+ } else {
+ Some(format!("Hi! My name is {}", name))
}
}
@@ -21,14 +20,11 @@ pub fn generate_nametag_text(name: String) -> Option {
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())
);
}
diff --git a/exercises/error_handling/errors2.rs b/exercises/error_handling/errors2.rs
index aad3a93f..1cd8fc66 100644
--- a/exercises/error_handling/errors2.rs
+++ b/exercises/error_handling/errors2.rs
@@ -14,7 +14,8 @@
// and add.
// There are at least two ways to implement this that are both correct-- but
-// one is a lot shorter! Execute `rustlings hint errors2` for hints to both ways.
+// one is a lot shorter!
+// Execute `rustlings hint errors2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/error_handling/errors3.rs b/exercises/error_handling/errors3.rs
index 460ac5c4..a2d2d190 100644
--- a/exercises/error_handling/errors3.rs
+++ b/exercises/error_handling/errors3.rs
@@ -2,7 +2,7 @@
// This is a program that is trying to use a completed version of the
// `total_cost` function from the previous exercise. It's not working though!
// Why not? What should we do to fix it?
-// Execute `rustlings hint errors3` for hints!
+// Execute `rustlings hint errors3` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/error_handling/result1.rs b/exercises/error_handling/errors4.rs
similarity index 78%
rename from exercises/error_handling/result1.rs
rename to exercises/error_handling/errors4.rs
index b978001b..0efe8ccd 100644
--- a/exercises/error_handling/result1.rs
+++ b/exercises/error_handling/errors4.rs
@@ -1,5 +1,5 @@
-// result1.rs
-// Make this test pass! Execute `rustlings hint result1` for hints :)
+// errors4.rs
+// Execute `rustlings hint errors4` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
@@ -14,6 +14,7 @@ enum CreationError {
impl PositiveNonzeroInteger {
fn new(value: i64) -> Result {
+ // Hmm...? Why is this only returning an Ok value?
Ok(PositiveNonzeroInteger(value as u64))
}
}
diff --git a/exercises/error_handling/errors5.rs b/exercises/error_handling/errors5.rs
new file mode 100644
index 00000000..2ba8f903
--- /dev/null
+++ b/exercises/error_handling/errors5.rs
@@ -0,0 +1,65 @@
+// errors5.rs
+
+// This program uses an altered version of the code from errors4.
+
+// This exercise uses some concepts that we won't get to until later in the course, like `Box` and the
+// `From` trait. It's not important to understand them in detail right now, but you can read ahead if you like.
+// For now, think of the `Box` type as an "I want anything that does ???" type, which, given
+// Rust's usual standards for runtime safety, should strike you as somewhat lenient!
+
+// In short, this particular use case for boxes is for when you want to own a value and you care only that it is a
+// type which implements a particular trait. To do so, The Box is declared as of type Box where Trait is the trait
+// the compiler looks for on any value used in that context. For this exercise, that context is the potential errors
+// which can be returned in a Result.
+
+// What can we use to describe both errors? In other words, is there a trait which both errors implement?
+
+// Execute `rustlings hint errors5` or use the `hint` watch subcommand for a hint.
+
+// 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<(), Box> {
+ 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 {
+ 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 {}
diff --git a/exercises/error_handling/errors6.rs b/exercises/error_handling/errors6.rs
new file mode 100644
index 00000000..1306fb03
--- /dev/null
+++ b/exercises/error_handling/errors6.rs
@@ -0,0 +1,96 @@
+// errors6.rs
+
+// Using catch-all error types like `Box` 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.
+
+// Execute `rustlings hint errors6` or use the `hint` watch subcommand for a hint.
+
+// 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 {
+ fn from_creation(err: CreationError) -> ParsePosNonzeroError {
+ ParsePosNonzeroError::Creation(err)
+ }
+ // TODO: add another error conversion function here.
+ // fn from_parseint...
+}
+
+fn parse_pos_nonzero(s: &str)
+ -> Result
+{
+ // 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 {
+ 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()));
+ }
+}
diff --git a/exercises/error_handling/errorsn.rs b/exercises/error_handling/errorsn.rs
deleted file mode 100644
index 5fe212bf..00000000
--- a/exercises/error_handling/errorsn.rs
+++ /dev/null
@@ -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 {
- 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> {
- 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 {
- 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 {
- 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 {}
diff --git a/exercises/functions/README.md b/exercises/functions/README.md
index 351ae023..6662d0da 100644
--- a/exercises/functions/README.md
+++ b/exercises/functions/README.md
@@ -1,7 +1,8 @@
-### Functions
+# Functions
-Here, you'll learn how to write functions and how Rust's compiler can trace things way back.
+Here, you'll learn how to write functions and how the Rust compiler can help you debug errors even
+in more complex code.
-#### Book Sections
+## Further information
- [How Functions Work](https://doc.rust-lang.org/book/ch03-03-how-functions-work.html)
diff --git a/exercises/functions/functions1.rs b/exercises/functions/functions1.rs
index 31125278..03d8af70 100644
--- a/exercises/functions/functions1.rs
+++ b/exercises/functions/functions1.rs
@@ -1,5 +1,5 @@
// functions1.rs
-// Make me compile! Execute `rustlings hint functions1` for hints :)
+// Execute `rustlings hint functions1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/functions/functions2.rs b/exercises/functions/functions2.rs
index 108ba38b..7d40a578 100644
--- a/exercises/functions/functions2.rs
+++ b/exercises/functions/functions2.rs
@@ -1,5 +1,5 @@
// functions2.rs
-// Make me compile! Execute `rustlings hint functions2` for hints :)
+// Execute `rustlings hint functions2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
@@ -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);
}
diff --git a/exercises/functions/functions3.rs b/exercises/functions/functions3.rs
index e3c1bf73..3b9e585b 100644
--- a/exercises/functions/functions3.rs
+++ b/exercises/functions/functions3.rs
@@ -1,5 +1,5 @@
// functions3.rs
-// Make me compile! Execute `rustlings hint functions3` for hints :)
+// Execute `rustlings hint functions3` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
@@ -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);
}
diff --git a/exercises/functions/functions4.rs b/exercises/functions/functions4.rs
index 58637e4c..65d5be4f 100644
--- a/exercises/functions/functions4.rs
+++ b/exercises/functions/functions4.rs
@@ -1,8 +1,11 @@
// functions4.rs
-// Make me compile! Execute `rustlings hint functions4` for hints :)
+// Execute `rustlings hint functions4` or use the `hint` watch subcommand for a hint.
// This store is having a sale where if the price is an even number, you get
// 10 Rustbucks off, but if it's an odd number, it's 3 Rustbucks off.
+// (Don't worry about the function bodies themselves, we're only interested
+// in the signatures for now. If anything, this is a good way to peek ahead
+// to future exercises!)
// I AM NOT DONE
diff --git a/exercises/functions/functions5.rs b/exercises/functions/functions5.rs
index d22aa6c8..5d762961 100644
--- a/exercises/functions/functions5.rs
+++ b/exercises/functions/functions5.rs
@@ -1,11 +1,11 @@
// functions5.rs
-// Make me compile! Execute `rustlings hint functions5` for hints :)
+// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
fn main() {
let answer = square(3);
- println!("The answer is {}", answer);
+ println!("The square of 3 is {}", answer);
}
fn square(num: i32) -> i32 {
diff --git a/exercises/generics/README.md b/exercises/generics/README.md
index 7105f06f..de46d503 100644
--- a/exercises/generics/README.md
+++ b/exercises/generics/README.md
@@ -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)
\ No newline at end of file
+- [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)
diff --git a/exercises/generics/generics1.rs b/exercises/generics/generics1.rs
index 967287ef..4c34ae47 100644
--- a/exercises/generics/generics1.rs
+++ b/exercises/generics/generics1.rs
@@ -1,6 +1,8 @@
// This shopping list program isn't compiling!
// Use your knowledge of generics to fix it.
+// Execute `rustlings hint generics1` or use the `hint` watch subcommand for a hint.
+
// I AM NOT DONE
fn main() {
diff --git a/exercises/generics/generics2.rs b/exercises/generics/generics2.rs
index 0cb59adc..aedbd55c 100644
--- a/exercises/generics/generics2.rs
+++ b/exercises/generics/generics2.rs
@@ -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` or use the `hint` watch subcommand for a hint.
+
// I AM NOT DONE
struct Wrapper {
diff --git a/exercises/generics/generics3.rs b/exercises/generics/generics3.rs
deleted file mode 100644
index 64dd9bc1..00000000
--- a/exercises/generics/generics3.rs
+++ /dev/null
@@ -1,58 +0,0 @@
-// An imaginary magical school has a new report card generation system written in Rust!
-// Currently the system only supports creating report cards where the student's grade
-// is represented numerically (e.g. 1.0 -> 5.5).
-// However, the school also issues alphabetical grades (A+ -> F-) and needs
-// to be able to print both types of report card!
-
-// Make the necessary code changes in the struct ReportCard and the impl block
-// to support alphabetical report cards. Change the Grade in the second test to "A+"
-// to show that your changes allow alphabetical grades.
-
-// Execute 'rustlings hint generics3' for hints!
-
-// I AM NOT DONE
-
-pub struct ReportCard {
- pub grade: f32,
- pub student_name: String,
- pub student_age: u8,
-}
-
-impl ReportCard {
- pub fn print(&self) -> String {
- format!("{} ({}) - achieved a grade of {}",
- &self.student_name, &self.student_age, &self.grade)
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn generate_numeric_report_card() {
- let report_card = ReportCard {
- grade: 2.1,
- student_name: "Tom Wriggle".to_string(),
- student_age: 12,
- };
- assert_eq!(
- report_card.print(),
- "Tom Wriggle (12) - achieved a grade of 2.1"
- );
- }
-
- #[test]
- fn generate_alphabetic_report_card() {
- // TODO: Make sure to change the grade here after you finish the exercise.
- let report_card = ReportCard {
- grade: 2.1,
- student_name: "Gary Plotter".to_string(),
- student_age: 11,
- };
- assert_eq!(
- report_card.print(),
- "Gary Plotter (11) - achieved a grade of A+"
- );
- }
-}
diff --git a/exercises/hashmaps/README.md b/exercises/hashmaps/README.md
new file mode 100644
index 00000000..30471cf9
--- /dev/null
+++ b/exercises/hashmaps/README.md
@@ -0,0 +1,11 @@
+# Hashmaps
+A *hash map* allows you to associate a value with a particular key.
+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.
+
+This is the other data structure that we've been talking about before, when
+talking about Vecs.
+
+## Further information
+
+- [Storing Keys with Associated Values in Hash Maps](https://doc.rust-lang.org/book/ch08-03-hash-maps.html)
diff --git a/exercises/collections/hashmap1.rs b/exercises/hashmaps/hashmaps1.rs
similarity index 85%
rename from exercises/collections/hashmap1.rs
rename to exercises/hashmaps/hashmaps1.rs
index b1dc0bbd..fd8dd2f8 100644
--- a/exercises/collections/hashmap1.rs
+++ b/exercises/hashmaps/hashmaps1.rs
@@ -1,4 +1,4 @@
-// hashmap1.rs
+// hashmaps1.rs
// A basket of fruits in the form of a hash map needs to be defined.
// The key represents the name of the fruit and the value represents
// how many of that particular fruit is in the basket. You have to put
@@ -8,8 +8,7 @@
//
// Make me compile and pass the tests!
//
-// Execute the command `rustlings hint collections3` if you need
-// hints.
+// Execute `rustlings hint hashmaps1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
@@ -39,8 +38,6 @@ mod tests {
#[test]
fn at_least_five_fruits() {
let basket = fruit_basket();
- assert!(basket
- .values()
- .sum::() >= 5);
+ assert!(basket.values().sum::() >= 5);
}
}
diff --git a/exercises/collections/hashmap2.rs b/exercises/hashmaps/hashmaps2.rs
similarity index 81%
rename from exercises/collections/hashmap2.rs
rename to exercises/hashmaps/hashmaps2.rs
index 7e25be7c..454b3e1d 100644
--- a/exercises/collections/hashmap2.rs
+++ b/exercises/hashmaps/hashmaps2.rs
@@ -1,16 +1,15 @@
-// hashmap2.rs
+// hashmaps2.rs
// A basket of fruits in the form of a hash map is given. The key
// 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
-// hints.
+// Execute `rustlings hint hashmaps2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
@@ -21,7 +20,7 @@ enum Fruit {
Apple,
Banana,
Mango,
- Lichi,
+ Lychee,
Pineapple,
}
@@ -30,7 +29,7 @@ fn fruit_basket(basket: &mut HashMap) {
Fruit::Apple,
Fruit::Banana,
Fruit::Mango,
- Fruit::Lichi,
+ Fruit::Lychee,
Fruit::Pineapple,
];
@@ -49,7 +48,7 @@ mod tests {
let mut basket = HashMap::::new();
basket.insert(Fruit::Apple, 4);
basket.insert(Fruit::Mango, 2);
- basket.insert(Fruit::Lichi, 5);
+ basket.insert(Fruit::Lychee, 5);
basket
}
@@ -60,7 +59,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 +67,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::();
+ let count = basket.values().sum::();
assert!(count > 11);
}
}
diff --git a/exercises/hashmaps/hashmaps3.rs b/exercises/hashmaps/hashmaps3.rs
new file mode 100644
index 00000000..18dd44c9
--- /dev/null
+++ b/exercises/hashmaps/hashmaps3.rs
@@ -0,0 +1,87 @@
+// hashmaps3.rs
+
+// A list of scores (one per line) of a soccer match is given. Each line
+// is of the form :
+// ,,,
+// Example: England,France,4,2 (England scored 4 goals, France 2).
+
+// You have to build a scores table containing the name of the team, goals
+// the team scored, and goals the team conceded. One approach to build
+// the scores table is to use a Hashmap. The solution is partially
+// written to use a Hashmap, complete it to pass the test.
+
+// Make me pass the tests!
+
+// Execute `rustlings hint hashmaps3` or use the `hint` watch subcommand for a hint.
+
+// I AM NOT DONE
+
+use std::collections::HashMap;
+
+// A structure to store team name and its goal details.
+struct Team {
+ name: String,
+ goals_scored: u8,
+ goals_conceded: u8,
+}
+
+fn build_scores_table(results: String) -> HashMap {
+ // The name of the team is the key and its associated struct is the value.
+ let mut scores: HashMap = HashMap::new();
+
+ for r in results.lines() {
+ let v: Vec<&str> = r.split(',').collect();
+ let team_1_name = v[0].to_string();
+ let team_1_score: u8 = v[2].parse().unwrap();
+ let team_2_name = v[1].to_string();
+ let team_2_score: u8 = v[3].parse().unwrap();
+ // TODO: Populate the scores table with details extracted from the
+ // current line. Keep in mind that goals scored by team_1
+ // will be number of goals conceded from team_2, and similarly
+ // goals scored by team_2 will be the number of goals conceded by
+ // team_1.
+ }
+ scores
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ fn get_results() -> String {
+ let results = "".to_string()
+ + "England,France,4,2\n"
+ + "France,Italy,3,1\n"
+ + "Poland,Spain,2,0\n"
+ + "Germany,England,2,1\n";
+ results
+ }
+
+ #[test]
+ fn build_scores() {
+ let scores = build_scores_table(get_results());
+
+ let mut keys: Vec<&String> = scores.keys().collect();
+ keys.sort();
+ assert_eq!(
+ keys,
+ vec!["England", "France", "Germany", "Italy", "Poland", "Spain"]
+ );
+ }
+
+ #[test]
+ fn validate_team_score_1() {
+ let scores = build_scores_table(get_results());
+ let team = scores.get("England").unwrap();
+ assert_eq!(team.goals_scored, 5);
+ assert_eq!(team.goals_conceded, 4);
+ }
+
+ #[test]
+ fn validate_team_score_2() {
+ let scores = build_scores_table(get_results());
+ let team = scores.get("Spain").unwrap();
+ assert_eq!(team.goals_scored, 0);
+ assert_eq!(team.goals_conceded, 2);
+ }
+}
diff --git a/exercises/if/README.md b/exercises/if/README.md
index b1157218..b52c3922 100644
--- a/exercises/if/README.md
+++ b/exercises/if/README.md
@@ -1,7 +1,7 @@
-### If
+# If
-`if`, the most basic type of control flow, is what you'll learn here.
+`if`, the most basic (but still surprisingly versatile!) 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)
diff --git a/exercises/if/if1.rs b/exercises/if/if1.rs
index 90867545..587e03f8 100644
--- a/exercises/if/if1.rs
+++ b/exercises/if/if1.rs
@@ -1,4 +1,5 @@
// if1.rs
+// Execute `rustlings hint if1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
@@ -7,7 +8,6 @@ pub fn bigger(a: i32, b: i32) -> i32 {
// Do not use:
// - another function call
// - additional variables
- // Execute `rustlings hint if1` for hints
}
// Don't mind this for now :)
diff --git a/exercises/if/if2.rs b/exercises/if/if2.rs
index 80effbdf..effddbb6 100644
--- a/exercises/if/if2.rs
+++ b/exercises/if/if2.rs
@@ -2,11 +2,11 @@
// Step 1: Make me compile!
// Step 2: Get the bar_for_fuzz and default_to_baz tests passing!
-// Execute the command `rustlings hint if2` if you want a hint :)
+// Execute `rustlings hint if2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
-pub fn fizz_if_foo(fizzish: &str) -> &str {
+pub fn foo_if_fizz(fizzish: &str) -> &str {
if fizzish == "fizz" {
"foo"
} else {
@@ -21,16 +21,16 @@ mod tests {
#[test]
fn foo_for_fizz() {
- assert_eq!(fizz_if_foo("fizz"), "foo")
+ assert_eq!(foo_if_fizz("fizz"), "foo")
}
#[test]
fn bar_for_fuzz() {
- assert_eq!(fizz_if_foo("fuzz"), "bar")
+ assert_eq!(foo_if_fizz("fuzz"), "bar")
}
#[test]
fn default_to_baz() {
- assert_eq!(fizz_if_foo("literally anything"), "baz")
+ assert_eq!(foo_if_fizz("literally anything"), "baz")
}
}
diff --git a/exercises/intro/README.md b/exercises/intro/README.md
new file mode 100644
index 00000000..d32e4a8b
--- /dev/null
+++ b/exercises/intro/README.md
@@ -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)
diff --git a/exercises/intro/intro1.rs b/exercises/intro/intro1.rs
new file mode 100644
index 00000000..45c5acba
--- /dev/null
+++ b/exercises/intro/intro1.rs
@@ -0,0 +1,30 @@
+// 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 `rustlings hint intro1` or use the `hint` watch subcommand for a hint.
+//
+// If you're running this using `rustlings watch`: The exercise file will be reloaded
+// when you change one of the lines below! Try adding a `println!` line, or try changing
+// what it outputs in your terminal. Try removing a semicolon and see what happens!
+
+// 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!");
+ println!();
+ println!("The source for this exercise is in `exercises/intro/intro1.rs`. Have a look!");
+ println!("Going forward, the source of the exercises will always be in the success/failure output.");
+}
diff --git a/exercises/intro/intro2.rs b/exercises/intro/intro2.rs
new file mode 100644
index 00000000..efc1af20
--- /dev/null
+++ b/exercises/intro/intro2.rs
@@ -0,0 +1,9 @@
+// intro2.rs
+// Make the code print a greeting to the world.
+// Execute `rustlings hint intro2` or use the `hint` watch subcommand for a hint.
+
+// I AM NOT DONE
+
+fn main() {
+ println!("Hello {}!");
+}
diff --git a/exercises/lifetimes/README.md b/exercises/lifetimes/README.md
new file mode 100644
index 00000000..72befb3e
--- /dev/null
+++ b/exercises/lifetimes/README.md
@@ -0,0 +1,17 @@
+# Lifetimes
+
+Lifetimes tell the compiler how to check whether references live long
+enough to be valid in any given situation. For example lifetimes say
+"make sure parameter 'a' lives as long as parameter 'b' so that the return
+value is valid".
+
+They are only necessary on borrows, i.e. references,
+since copied parameters or moves are owned in their scope and cannot
+be referenced outside. Lifetimes mean that calling code of e.g. functions
+can be checked to make sure their arguments are valid. Lifetimes are
+restrictive of their callers.
+
+## Further information
+
+- [Validating References with Lifetimes](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html)
+- [Lifetimes (in Rust By Example)](https://doc.rust-lang.org/stable/rust-by-example/scope/lifetime.html)
diff --git a/exercises/lifetimes/lifetimes1.rs b/exercises/lifetimes/lifetimes1.rs
new file mode 100644
index 00000000..58e995c6
--- /dev/null
+++ b/exercises/lifetimes/lifetimes1.rs
@@ -0,0 +1,26 @@
+// lifetimes1.rs
+//
+// The Rust compiler needs to know how to check whether supplied references are
+// valid, so that it can let the programmer know if a reference is at risk
+// of going out of scope before it is used. Remember, references are borrows
+// and do not own their own data. What if their owner goes out of scope?
+//
+// Execute `rustlings hint lifetimes1` or use the `hint` watch subcommand for a hint.
+
+// I AM NOT DONE
+
+fn longest(x: &str, y: &str) -> &str {
+ if x.len() > y.len() {
+ x
+ } else {
+ y
+ }
+}
+
+fn main() {
+ let string1 = String::from("abcd");
+ let string2 = "xyz";
+
+ let result = longest(string1.as_str(), string2);
+ println!("The longest string is {}", result);
+}
diff --git a/exercises/lifetimes/lifetimes2.rs b/exercises/lifetimes/lifetimes2.rs
new file mode 100644
index 00000000..c73a28ad
--- /dev/null
+++ b/exercises/lifetimes/lifetimes2.rs
@@ -0,0 +1,27 @@
+// lifetimes2.rs
+//
+// So if the compiler is just validating the references passed
+// to the annotated parameters and the return type, what do
+// we need to change?
+//
+// Execute `rustlings hint lifetimes2` or use the `hint` watch subcommand for a hint.
+
+// I AM NOT DONE
+
+fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
+ if x.len() > y.len() {
+ x
+ } else {
+ y
+ }
+}
+
+fn main() {
+ let string1 = String::from("long string is long");
+ let result;
+ {
+ let string2 = String::from("xyz");
+ result = longest(string1.as_str(), string2.as_str());
+ }
+ println!("The longest string is {}", result);
+}
diff --git a/exercises/lifetimes/lifetimes3.rs b/exercises/lifetimes/lifetimes3.rs
new file mode 100644
index 00000000..ea483708
--- /dev/null
+++ b/exercises/lifetimes/lifetimes3.rs
@@ -0,0 +1,20 @@
+// lifetimes3.rs
+//
+// Lifetimes are also needed when structs hold references.
+//
+// Execute `rustlings hint lifetimes3` or use the `hint` watch subcommand for a hint.
+
+// I AM NOT DONE
+
+struct Book {
+ author: &str,
+ title: &str,
+}
+
+fn main() {
+ let name = String::from("Jill Smith");
+ let title = String::from("Fish Flying");
+ let book = Book { author: &name, title: &title };
+
+ println!("{} by {}", book.title, book.author);
+}
diff --git a/exercises/macros/README.md b/exercises/macros/README.md
index b48b880a..31a941b7 100644
--- a/exercises/macros/README.md
+++ b/exercises/macros/README.md
@@ -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)
+- [The Little Book of Rust Macros](https://veykril.github.io/tlborm/)
diff --git a/exercises/macros/macros1.rs b/exercises/macros/macros1.rs
index ed0dac85..634d0a70 100644
--- a/exercises/macros/macros1.rs
+++ b/exercises/macros/macros1.rs
@@ -1,5 +1,5 @@
// macros1.rs
-// Make me compile! Execute `rustlings hint macros1` for hints :)
+// Execute `rustlings hint macros1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/macros/macros2.rs b/exercises/macros/macros2.rs
index d0be1236..f6092cab 100644
--- a/exercises/macros/macros2.rs
+++ b/exercises/macros/macros2.rs
@@ -1,5 +1,5 @@
// macros2.rs
-// Make me compile! Execute `rustlings hint macros2` for hints :)
+// Execute `rustlings hint macros2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/macros/macros3.rs b/exercises/macros/macros3.rs
index 93a43113..106f1c6d 100644
--- a/exercises/macros/macros3.rs
+++ b/exercises/macros/macros3.rs
@@ -1,6 +1,6 @@
// macros3.rs
// Make me compile, without taking the macro out of the module!
-// Execute `rustlings hint macros3` for hints :)
+// Execute `rustlings hint macros3` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/macros/macros4.rs b/exercises/macros/macros4.rs
index 3a748078..c1fc5e8b 100644
--- a/exercises/macros/macros4.rs
+++ b/exercises/macros/macros4.rs
@@ -1,5 +1,5 @@
// macros4.rs
-// Make me compile! Execute `rustlings hint macros4` for hints :)
+// Execute `rustlings hint macros4` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/modules/README.md b/exercises/modules/README.md
index bb765106..3dc8a482 100644
--- a/exercises/modules/README.md
+++ b/exercises/modules/README.md
@@ -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)
diff --git a/exercises/modules/modules1.rs b/exercises/modules/modules1.rs
index 812dfeef..8dd0e402 100644
--- a/exercises/modules/modules1.rs
+++ b/exercises/modules/modules1.rs
@@ -1,10 +1,16 @@
// modules1.rs
-// Make me compile! Execute `rustlings hint modules1` for hints :)
+// Execute `rustlings hint modules1` or use the `hint` watch subcommand for a hint.
// 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!");
}
}
diff --git a/exercises/modules/modules2.rs b/exercises/modules/modules2.rs
index fde439d1..c30a3897 100644
--- a/exercises/modules/modules2.rs
+++ b/exercises/modules/modules2.rs
@@ -1,11 +1,14 @@
// modules2.rs
-// Make me compile! Execute `rustlings hint modules2` for hints :)
+// 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.
+// Execute `rustlings hint modules2` or use the `hint` watch subcommand for a hint.
// 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";
diff --git a/exercises/modules/modules3.rs b/exercises/modules/modules3.rs
new file mode 100644
index 00000000..35e07990
--- /dev/null
+++ b/exercises/modules/modules3.rs
@@ -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!
+// Execute `rustlings hint modules3` or use the `hint` watch subcommand for a hint.
+
+// 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!"),
+ }
+}
diff --git a/exercises/move_semantics/README.md b/exercises/move_semantics/README.md
index 6842af7c..54ddd8e6 100644
--- a/exercises/move_semantics/README.md
+++ b/exercises/move_semantics/README.md
@@ -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.
diff --git a/exercises/move_semantics/move_semantics1.rs b/exercises/move_semantics/move_semantics1.rs
index e2f5876d..aac6dfc3 100644
--- a/exercises/move_semantics/move_semantics1.rs
+++ b/exercises/move_semantics/move_semantics1.rs
@@ -1,5 +1,5 @@
// move_semantics1.rs
-// Make me compile! Execute `rustlings hint move_semantics1` for hints :)
+// Execute `rustlings hint move_semantics1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/move_semantics/move_semantics2.rs b/exercises/move_semantics/move_semantics2.rs
index bd21fbb7..64870850 100644
--- a/exercises/move_semantics/move_semantics2.rs
+++ b/exercises/move_semantics/move_semantics2.rs
@@ -1,6 +1,6 @@
// move_semantics2.rs
-// Make me compile without changing line 13!
-// Execute `rustlings hint move_semantics2` for hints :)
+// Make me compile without changing line 13 or moving line 10!
+// Execute `rustlings hint move_semantics2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/move_semantics/move_semantics3.rs b/exercises/move_semantics/move_semantics3.rs
index 43fef74f..eaa30e33 100644
--- a/exercises/move_semantics/move_semantics3.rs
+++ b/exercises/move_semantics/move_semantics3.rs
@@ -1,7 +1,7 @@
// move_semantics3.rs
// Make me compile without adding new lines-- just changing existing lines!
// (no lines with multiple semicolons necessary!)
-// Execute `rustlings hint move_semantics3` for hints :)
+// Execute `rustlings hint move_semantics3` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
diff --git a/exercises/move_semantics/move_semantics4.rs b/exercises/move_semantics/move_semantics4.rs
index a1c4a413..99834ec3 100644
--- a/exercises/move_semantics/move_semantics4.rs
+++ b/exercises/move_semantics/move_semantics4.rs
@@ -1,8 +1,8 @@
// 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
-// freshly created vector from fill_vec to its caller.
-// Execute `rustlings hint move_semantics4` for hints!
+// Refactor this code so that instead of passing `vec0` into the `fill_vec` function,
+// the Vector gets created in the function itself and passed back to the main
+// function.
+// Execute `rustlings hint move_semantics4` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
@@ -18,7 +18,7 @@ fn main() {
println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1);
}
-// `fill_vec()` no longer take `vec: Vec` as argument
+// `fill_vec()` no longer takes `vec: Vec` as argument
fn fill_vec() -> Vec {
let mut vec = vec;
diff --git a/exercises/move_semantics/move_semantics5.rs b/exercises/move_semantics/move_semantics5.rs
new file mode 100644
index 00000000..36eae127
--- /dev/null
+++ b/exercises/move_semantics/move_semantics5.rs
@@ -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` or use the `hint` watch subcommand for a hint.
+
+// 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);
+}
diff --git a/exercises/move_semantics/move_semantics6.rs b/exercises/move_semantics/move_semantics6.rs
new file mode 100644
index 00000000..eb52a848
--- /dev/null
+++ b/exercises/move_semantics/move_semantics6.rs
@@ -0,0 +1,25 @@
+// move_semantics6.rs
+// Execute `rustlings hint move_semantics6` or use the `hint` watch subcommand for a hint.
+// 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);
+}
diff --git a/exercises/option/README.md b/exercises/option/README.md
deleted file mode 100644
index d17b79cc..00000000
--- a/exercises/option/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-### Option
-
-#### Book Sections
-
-To learn about Option, check out these links:
-
-- [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)
diff --git a/exercises/option/option1.rs b/exercises/option/option1.rs
deleted file mode 100644
index 602ff1a9..00000000
--- a/exercises/option/option1.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// option1.rs
-// Make me compile! Execute `rustlings hint option1` for hints
-
-// I AM NOT DONE
-
-// you can modify anything EXCEPT for this function's sig
-fn print_number(maybe_number: Option) {
- println!("printing: {}", maybe_number.unwrap());
-}
-
-fn main() {
- print_number(13);
- print_number(99);
-
- let mut numbers: [Option; 5];
- for iter in 0..5 {
- let number_to_add: u16 = {
- ((iter * 1235) + 2) / (4 * 16)
- };
-
- numbers[iter as usize] = number_to_add;
- }
-}
diff --git a/exercises/option/option2.rs b/exercises/option/option2.rs
deleted file mode 100644
index a1517d7c..00000000
--- a/exercises/option/option2.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// option2.rs
-// Make me compile! Execute `rustlings hint option2` for hints
-
-// I AM NOT DONE
-
-fn main() {
- let optional_value = 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);
- } else {
- println!("The optional value doesn't contain anything!");
- }
-
- let mut optional_values_vec: Vec