├── .DS_Store ├── README.md ├── _minted-rust ├── 0136274EDF8AC8B075B6DF2354D6C248D59F5489C1365D2260FCF1D25A3688A1.pygtex ├── 01DF6B8BD87CA6D4AC06669FE647E06B12D591DC9FFC1DD8C268FA8A9806554C.pygtex ├── 025B13374B8CCC8CF79BA217AC543530419C7F52CC0184153B8517AD583A75C0.pygtex ├── 030920CD8F5EAA0153133E81C69DE489667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 034BE177E34B6440F5D48C35FBFC54B6667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 0406306B50A51047BA52F18AB2CC9D65583E5D4CA16011270E20C3B722947CC1.pygtex ├── 0459587B1AD59669987C6C8DB91F2115667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 0525D55B9514301FFB1A74F1B5946A69BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 0566808D94FF7D6E18C36ECDECFAB39795442FA63EDF9CEC8F151E0792E00201.pygtex ├── 056EBD4D1B488A582E57CE09D47E95852758F7FE71260626CCADAAD450B1E83D.pygtex ├── 05735A5115D8FFA46FA5AFA7EDEF6CE07F7623E59A411E74FCB9C89779016426.pygtex ├── 0613D123FF3EFB757D6397CB9E696467BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 064F6F9647F90CD75A7F13D6BC8C57C57FAD34B8F8EF9DF8B43C43A1367472C4.pygtex ├── 0669FB1192972E0FD119A954245E4F18BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 0724CF689080945D04200DE4ACF501D9BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 085F85C7DF3130C8E5F5E66D396019CCBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 08A44A9BA3FAF4FB64DC66912150E2E395ADC5738DC216D295D53066DB815876.pygtex ├── 08B0B8BD0B252EE3B90953FDA7B3FEF7A94DBBAE6735F3FFB978C1D74C2BC820.pygtex ├── 0A079745EE65FA442EDB881778A3E480BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 0A9095273404079770F6C9CABFE8FEA043EA75B72D1E75E95A3E016B4FA2E5DA.pygtex ├── 0B0D241ECE795AC989B7743ADBFC789D503F0563F750ACD98E53760F8F7D3586.pygtex ├── 0C5C912B6F81DFE7A83A5E660D2875B19075809CD00F659A71198DC5CA600723.pygtex ├── 0C7ECFE6FABF701FB9912911DDDC5C3133B6F00199D5946E10E0BD65123D9A36.pygtex ├── 0C814C900D0457F40BC9E6B26572877F4CA017F8D1B7ED2573A2E6901452B99A.pygtex ├── 0CC5B83C52D2979AEBCCACBC01C12E23D716C4F9745881A70CC5EA64AD5754A4.pygtex ├── 0CCFC2EF3F1E07ECD68D8CE74C734AA5EFF21A1EA1CBCD4151493A318D9A6EC3.pygtex ├── 0D63EE436D8BD71FC19F9061B23964D4BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 0DF3BF94A5077C0E4ED5168114426281BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 0EDBF440A93B9F067CBB4FEECAC9F1712765FCB86098CA6F9EFFF4904DE081F3.pygtex ├── 0F4E0AA84AA57FCDB39750D2C513C426AA246C2FB32C6F84120F10B10B36864D.pygtex ├── 11063EA59C943AF24818C484101D9013BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 11DB1D36543B9B371B8DA36D81391B363C2D77061B312EFCAFEC46DDEA17B9AD.pygtex ├── 11FDE18D6CE96EF37A77363E0E073491BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 12A97E334B8433B56ABF9D9655E3933672AB2117DBAA45B25EB6CEF07F065D64.pygtex ├── 130E0AC6E53F3432DE62EFB4A58B7F8DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 13831295B98A025FD56C1C03980A48A9488D93D3805C785761A46559CF305966.pygtex ├── 13831295B98A025FD56C1C03980A48A951FCF25B9C8E08DCCF39CF1A0032414F.pygtex ├── 1400DD83DB0F5AC7D25D6F96BE6E97072AF9BE82E0BB8825C9B489C30B842609.pygtex ├── 14B7FD92A9654A10F9E7FC7DD1EAC36922945D28FE75B3BEC56E846AECB7DC3C.pygtex ├── 152CC86959B07FC5168DF0CE7397E74A50B750D623C93026F92385CB02BF9C67.pygtex ├── 153C758644C56B05C34C288B415443206CCF2203BABC0111F7F2CA411D22EAE2.pygtex ├── 153C758644C56B05C34C288B415443208014C3CC4B5BCCDD1891BDADAFC0A839.pygtex ├── 1577447EE8BA61BBCCC40673CCD1F7E2BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 1594C145D8ED01B7DA0790CE8E2CF669817E4A23C22766977F804F074B610689.pygtex ├── 15E13B5AA27BC123EBE41C7238022419BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 1602AF8A8A70918CFBD4DD16E7FAA3B7BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 1637D00CEF65B8BC499B1F2EAD71B4B4BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 16F7381E2023A9B120A5485456415351BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 179F52ACCFFB0C4C779B71BAF39D3432A7833087C4CD604D809DD6C987ECC024.pygtex ├── 17AE8AAB5F1EA0991502017E9535DDC240CD1B57F01012476191E97C5B56EBBA.pygtex ├── 17C537FBC72988FFFEBA154EFA43223ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 18325CC100E96A710BC1DF5EA2113B8583F94C8B40F8DF273EB9F9CE241066B7.pygtex ├── 184606C9F73505E0BA78B31798CC2264EF5BA6DDE9FA7034E5DCB35542352D13.pygtex ├── 188D758B68F5637E3D03EFD03F0E8E895C1E10D8FD892FB6218595225E38E3E4.pygtex ├── 189D70D74792DBC4B462721EB65CCD19BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 190AB8D28A7B920AFC59276C60EC67C7B1D9D988A97C41871C4228158536076B.pygtex ├── 19CF355A1FE33BFD89A18299A73F7F86BFBE258336EB5E56A554DD9A10B78B90.pygtex ├── 1AE2B7D3BF485B1CA7B12974C196E1946D519C1051DC83F7D320850F579EB4FA.pygtex ├── 1B34B8CD4427E76BCFD58373B9284292667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 1B791D06BD957AEB47B0F5BA6B9CEB82F50A29EFE11D7B2BA443AF2152D5DC98.pygtex ├── 1B8700FBB15D62BD6A053DFD331F13BAD6780C9B890B2179C8FB85A264DC99F3.pygtex ├── 1C1FCDC9105056CAE5271F53D442A6A0835AAD90D234455A04442FA69BE04011.pygtex ├── 1C3853261CB4A25ED7BC23752C69A72ECD4C726882A61CAD22B3011EE96E8533.pygtex ├── 1C6116A02C3796DE590959AF32FD8FA8011D21A17A497F45ED60D0D7C759869D.pygtex ├── 1C80012486BFF5A84D55B45B8E8ECE9ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 1CEF5EF42F564FCE9DCEBBBBB90A993895E74AADE7CCE5C52DBB8331B275E74A.pygtex ├── 1D3EEBCBA5AD7E17FF9073BFEB68D8956A4445092A59F2E474CF518FA90D48D8.pygtex ├── 1DC62DFD3613B1EAB390A9CBF97D96C4A4E7AA594C05EB8E589AC7DF951AEDA0.pygtex ├── 1DC6F367A8C1F51EFB70741350B3D632703C41B8E4E3F4C36822AB0C6BE4188D.pygtex ├── 1DF4BA65BB31A8615B4E6265255C9215B23515A179F99A75094EEDD742142F84.pygtex ├── 1EA806FA712A9A10AADE254430D949AABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 1F44209D7277705C17969FEA1C8947FBE056B6BCD4EA84BEDF155E2A6FEADE8C.pygtex ├── 1F4FB03CA21337368C728023607A2089C75F2BAA6DBB7A991F53E8A2437011B0.pygtex ├── 1F6CC9B8A40E8112C34D12B429CEB09E712ABD7E546AED5C17E13AE7F8B94C85.pygtex ├── 1FF7E2AEE6AA94A64E7A648A4D34E0F0CB59EB46CEEED3F73EA33B67109F6513.pygtex ├── 2150F59AE8927B4BC1DC2ED22EA985442D9A07058753A6FD2E3068EFF348EEDA.pygtex ├── 223A44A10224B1563FAEAC699EAB6D4AC8B88F5C85502531D3561E542A94674C.pygtex ├── 226EAB3040EBC20D7B9F7E1C3B3D96C7D1B18A458E56BAC6CEF94C00669F8E7C.pygtex ├── 22B43111CABC2C8F251FEC6F4C8BE95E231217E79A712A7FEE525201C77B0ADF.pygtex ├── 2316911A14C8D2D01A4CF835548A8FA4BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 23615653F876F6F6FF34942F655EB4A6667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 23EDF6A734A9D53779BE8BE1830D0EEE73581CDA2214C75200D516C2C4A68EB8.pygtex ├── 25B3A31812C516FFB6753757E643DD98372D09975F32597EB6974F159D17680C.pygtex ├── 2703900F3A9291049AB8070A33F29C65ABAD1EBB955A9C3258E26DD1DE894471.pygtex ├── 276CCFBF89BE5BA5F14CCE95AB9CD6893BC9726DD6FDAADA5233074AC18C2136.pygtex ├── 2945B4C8DF21A1A06CA2A45C469A9351F8F8447798A62BF274E5193E899018A6.pygtex ├── 298B78502EA6E83CE9E53D707FCD16B0BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 29C07820244B34167CF6B1477AEA795C0671911A603AFD7D166F3B4D694F3492.pygtex ├── 2A5E1319C18D5E86561E2A55E3CB82BB4F73A75B5AB1610BEA368A06CA5B9B34.pygtex ├── 2ACFF0BB09E7D2C78CB5DF746908AAB5DC61CF238EADAF487DCD3A7B0830CA7A.pygtex ├── 2B7EAE470DD7A7D0F619524393C70159F21AF3D6D2BD1DCCC4A6ACBC7A2D6C2F.pygtex ├── 2BD46A4AF45D90B5EFCD6AC897762BE45AF1E7438DFEA9E4215D8F0AB0829CEF.pygtex ├── 2C4D86D8EC33151769C06D3093713B9E0C6FC8D5D3CC0E028D3C3EB9B1003390.pygtex ├── 2D477196F36D93DE966009E51A95A13FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 2E20DEAEC0886436256F3D5534875072F3A868BFB47A6B45B1396DBC8FE053E8.pygtex ├── 2E74E2C33D19A0EF2398EA27B3F9908805C9EEEB6429E75EC03FD4D78B01BD20.pygtex ├── 2E7F0EFE788BB9AD687981E4D40AAF28BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 2EA11653C99AC1E203BF76673A96CEF8F0C4D6E1D79AA23E94641775C8561673.pygtex ├── 2EB12577A06B11263335EFBED8E67EB9707C27D061C92BEE6C2D7894AEB085A0.pygtex ├── 2F5635C49EDAE5D5A0F83F32CB153860BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 2F9AB910A053CB66E0D62E8323E9F653667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 30431071B5CB223F15791A0954266AE89C687E5EB02A01F98FB5652ABF6F1CAA.pygtex ├── 30794C4B5C2C164387C7DC24C9208EA5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 30F9C22BCE775CD738828C548E795199BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 313BA0568DC3F44D4EB59336D5ADE2D192FBA61EBB89C2158F567FE255E79AF9.pygtex ├── 313BA0568DC3F44D4EB59336D5ADE2D1F4E0D2AC99FDC3C8C17BCC128C2F8698.pygtex ├── 315618E4AC2435A663736660414F2C0ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 327B21B3BAC26A70C26A9B6D381C1449BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 332D4AD22CD5C611778BBC3EBBE655FA40FE446215BF05171600B56673D137FA.pygtex ├── 3419E71A069B0C7DB2DC740BA3449C07A3FB9D5A9B02E53496E22A4D686BCB80.pygtex ├── 344359A93E340C4388E7260B0562A44CC8963E442743AFB8DDB81B951C1A1B3F.pygtex ├── 34525F881DB46B21F3EACF7BC7B43C572EE88AA5BDFAB4CED264234BAE3FEB92.pygtex ├── 355868FACECDE95DB822418A42A2833EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 367756AB05BB11B01EE007B6EBE70DA99BCED3A49F9A59C2300F15257BA7480D.pygtex ├── 369990B384D3CB76276C5AA5C98725C9667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 36DF9B0B7D77B2F4201AC32C28E82AE9DBF1186026CA89A1872F07E15B94D84B.pygtex ├── 37114F85A39F9615778A327C546EB4ADBF2C1741FCCA9E17C2F8A0F326649D17.pygtex ├── 37AA7C10D186892F8562CEC52648DAE87DBA9A1AF5D587E45B8215FA87A310D2.pygtex ├── 38179210141925AF1335DAABF6C4D4938140230E0A650C6D15BB6F3A06CA7D0C.pygtex ├── 38DE58453F8D8C0A3473024A58075DDCA0C2A3BE87D1981A40B2394F68103500.pygtex ├── 3971614FDDD0616F488467013242448ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 3A05CFF250ECA7562796C846CE99FACCBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 3A0E962027D4C0CD274F9BCD1DEE8208A9E1E17BB3CC20AC21E2A52BB50DB970.pygtex ├── 3C18731E6AD29DABE07C13621C3867AD8E2A68AB45FB61F4C7924CCDA6B9155E.pygtex ├── 3C24D9D0F9F0F64F2F5A0A9DA8DA1C335858A8720D191A221A10ED994A459B75.pygtex ├── 3D3DB0FEB66824438CAC2B09FC60049A667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 3D8FC9BE4B9FB51B69E0F2D13FB7D53670262A49F388092D419C6EDCE22B3C1E.pygtex ├── 3D9045C37E09BD614DC696604DA7D6BCBA5787EA019095DDD1C40D734B0305BE.pygtex ├── 3DB4FBEA66C5571D2E5DCF9BEA4D07DBBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 3EF810E430EB8D686333162D370C674396B2A85B7A15075C227D3DE10C6669A3.pygtex ├── 3F20B861E06539F23B3AF2935665A141BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 3F363695F473913D5D4340D16E8CAA2A2526DDB7297FFB08D92DF4E8224374B9.pygtex ├── 3FC55EC19CABE5C2D41512941734C90BBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 3FF040372C25309CEA77AA50E4CF5C3FDB6B2E67B549AD6D750F5FB881141886.pygtex ├── 401B30E3B8B5D629635A5C613CDB7919BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 404354AA7C7FEBC4ECF98D857A674D647CB014417DC07AF1635EB20B95FDCD57.pygtex ├── 4056A5F816EE81F2EED79AE6F1DCFAA574C73E5319DDE927510D49ED2F68D228.pygtex ├── 408E79736E82C795E40C487A96841395D2AD29F8353D2161F8E237DF6CF07678.pygtex ├── 433D38F0A11E431A5AF08CCE8B8DAFCB91F8AC9494A87EF4C213C53C8DE37003.pygtex ├── 436C5ED0EC5A08D7D0DABAE4F916E97CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 452F8C9511E07BDD07BAFD7F0296DF9E2342026AFDD1D33535047B9C5F87D572.pygtex ├── 459A4216C99710A0FADA2D433AE81ADACD8D131A8E079B46E79EA1CE9AF83942.pygtex ├── 45CF9E626C683BFD29B51558881F7F38D4ACF6A39539E3B87ABB77657560A16D.pygtex ├── 45D34917C0A4519C762B1AC1A70DEC0CB1CA295D5D87F8D409F48723AE060FD5.pygtex ├── 4688F6A61F09213ABFB220C50003A8C676E21C54F9574C3A498912865745484D.pygtex ├── 47BBE4575A8AC31060C657741E05B9B6032DE0FF635BC2CC20D662F06761E1A9.pygtex ├── 490AA95E91E6FB475BCE466D805FBF1E1B6815AA53777ACF733DF02E4E9BC96B.pygtex ├── 49A6D2F7FFA12B8A2DC8602737377189F56057346E00B6D7BD67BF02F9DE315A.pygtex ├── 49AE6A739A179A7BB3A14B4CFC7EA1D642827DFA55AACBE54BF0ED69DBC12874.pygtex ├── 4C3A6EAD8E1A72A680911762420D2A846813457005069D77CF179BDDC387B853.pygtex ├── 4CD3FBC7FBFF698FBF84AF4AFB8F0B1BBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 4D1258AAF9722FAAE5D3880736694981BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 4D70E93C98A3A5FF1E7E5160D909A9B9BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 4D7DDDAF2010054184F62EB6A5C8E75D354BE048A1EFB8DB4B5A20289C593054.pygtex ├── 4DC8884F1E08F8511F2B61493D4B6C7DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 4EC086DF2EAF80EFA5E2146E611EDA38667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 4EF71535027C2EA5EB94AA4D58753A38BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 4F0361C08B91250453911B4381E6C65CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 5066BBD66031ED95EAB7D3BB1E9BB3B9667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 51239C0558DEC0B1465546626D4A9011BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 513A8F0D174F0F50D73D5A904B0DDBDEBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 514B6C1CBC65B3F8A0E7493F5AC8D1B746293D9E7FB0E58C2DCCBBD9928C6431.pygtex ├── 5171C1BF6111942B651DB8086DFE45BC667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 51722AA88F419BEC24F8DB9335CA687C3E750CDE8E21CECB39F6D5ED75455CE9.pygtex ├── 5298C3ED2BF8AC9BB5D0EC0C38CEA25D5A60F9C840B87143D3F83641CF42F6C6.pygtex ├── 52B50126C3FCFBE316E9E3F71C06EA63BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 52DECBEF766685AD0037EFB190C95A19BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 533EC25ED85B0A4920215C4535DA6C7F88AA8AB786E3D15A617BB8D8DF6E9F49.pygtex ├── 53B2C4D17C671AC290C301A22E8B9BC2BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 541C788249A72DFB0B921530D7DF0B3B3E3F62FE9BD900F41BC315004127F526.pygtex ├── 54A32FD742E5F66A0D8EC494C0D86D266F4AF61019D1F72CCB4BF2CDA8B502D6.pygtex ├── 550006A52410A80746C6C37D0C800416F62F46EC8D53665D64F6C0E385FE6B9E.pygtex ├── 55033C0600E163C847C9D8A6368F2AD6667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 550AD2DC9CE7C5CFF074CCCDBFB690DBBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 550B6A76825108FD45D9B11BED940E5E5118E3B057FD5ECF3DEE5C58A92B174B.pygtex ├── 5677C7B2123BE8929B17D8E2AA416E45BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 57629EC8CFC4115CCD1A2A85C6CCD1253BA4176BA2BEA4B5863F8EB4B2125738.pygtex ├── 57C2C1EF0E95A50A66C908319D5A5728488F77E5BAC9BB0281AF13138DA3D97E.pygtex ├── 58D5D945093F09A7470F06248D2FA8F6BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 592D385BD1B4DF83608A9A591A7E5DA5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 59A9187D43A23CB3DDF3654AFAE208BDFE03581FBA061950DB3F6FD15C3DDDC2.pygtex ├── 5A0B89D91D49ABF0858EA4E167D1E6736B6F670CCCD2AD615A80D3A8E0080EBE.pygtex ├── 5A8D0618470CEF940045F967D9B8E887BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 5B173D4AECCBFEC877115CF2DCCF7010489A2FD451068084B14A73B9A47A660F.pygtex ├── 5B59D50474F73C5AA6B13265643F22B5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 5B9DC9AC2F273621C692C69059EE0C16621BF52AB947CB8A0AE011F2FDD9F9C2.pygtex ├── 5BED392F32BFA66C7A26A3F07211126BC71E7DDC18F7DDEC26167C8C83A9D7D5.pygtex ├── 5CCCDA3A4DB444C746A5A7C5A9CEFBE94636E6562D777168745F311AC21FE91B.pygtex ├── 5CFB95E79573A1E97DD44C24BEE61CF5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 5D0FA8D7982F124AD48F37BB1F447E26ECD383EA8C99DC9C19D3713F4B56268D.pygtex ├── 5D78ADCC366017B499CCFF33F4DE2C2EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 5DB1898199C115DEDC306E6AEEE1D8B46DACB70469D91D6B1643D68CEC2BB45C.pygtex ├── 60A73A240693B7E8CBB92428ACF62CABA8286F8352AAA4E51110EDDB8B09B1C2.pygtex ├── 60C8387A9869783318B1E80E4D055687BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 615C7143E9136A0C618DF647FB1B2231BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 61AE434CEB8D2CBEBD5DEF1CE4ADDFF8BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 61C8E67A2F99E3CE3E9E7C6F4C5D47BABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 61F8D2946F5FEAD34B8926302D7B3CF1D109851BE5E3445E9BCE9D3F860996AB.pygtex ├── 62279AC2069A0E7941DADC9E5DB83B4664A9B77A82EA46EFB5C4FC84C3E4BE6A.pygtex ├── 62E967C71471692FBEB79DA98B992147667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 632A43372BF6CBAB37C2CD004A3BA6AA5B768BD27923C862E31511AA485FE4A5.pygtex ├── 63335E9D1EF6818124D0C0E1B11D204E356D46382A3666923748FB9A25D9EFF8.pygtex ├── 642F6DF983512085FE3D2F4379660015ACE8298B35EE4234BB863F24E2BE3946.pygtex ├── 649E3E60D6A4B7EC8469D8C5B9EAD323667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 66B7AD8C06B9D6D1945C619E52DE8794A4CC54A011215198AE93AA697AE98C49.pygtex ├── 66CA62970CD55E69A903AC3B40C557CFE5FA5A2D17A7ADB64C5F8C28F2AE3C24.pygtex ├── 671B29F0F4A05D1A66AA8D2AD55E8DD08AEC24D97B3C3AAC35D04C0BAF75C55D.pygtex ├── 67F93619795C926C8009732AA1B8084678C0CB20039E39D75CCB62BFC7E93581.pygtex ├── 684AE6306A2EECB4BA9BF1E55300587514FC8E9253423B78F6D68C782EE391E6.pygtex ├── 684AE6306A2EECB4BA9BF1E553005875C3F364476F7ADDA4E0796B01FAEA1B43.pygtex ├── 684EE9A17DE7E1A16BB57A50368F9273BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 687728CEDD52EDC41B71AAAE19C70E42667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 689B707814ADF97FB5729759D844F3A6BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 68CEB6E031967FE0BDE5261537F589E16748D3FC328C9E4CBBB2089A7B510E27.pygtex ├── 694DC3F4B69852159C44C1912EF939D832936E40BC19E6981F878C221763C2D3.pygtex ├── 696A67E9557FFD9D5BED06FAC16B865EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 6A241C96591B71B8A6A1E6AE9258A556DA190F9D2F0B9BCA858FCA201EBEC5DB.pygtex ├── 6A352A729213E27E8F49F04B36676B7A667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 6B7C4D40CF907951AAA444096A6E4B80667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 6B7C4D40CF907951AAA444096A6E4B80BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 6CEA4951690FBCB41218AB4EA95E5CC27A8173A030175F24BBC15B0F0CEE8A80.pygtex ├── 6D2182EA7F85FFE320F1C5A236E95900DD7808A145D4D3E82CA2E8B1BDBD945C.pygtex ├── 6E2F2D52A25B14E2F06AC3725AAD1B50BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 6EF0D67E7F9C9DFFF88070FFE6DB9717667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 7005BA0BBCA516AD8B8C7C582B16DCA1BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 7010193AF90EEEC95D63DCE1E2A168B680FCAC1D7315B1F73AEE679907922EDA.pygtex ├── 70F486C88CFFD36E072F4F32A59420DC834DC059EB3B95D2DEF94EA9BAE69B0C.pygtex ├── 7177BA624D8EB6B86326F6C8E244B6C32F4BFE4B562F5680611E84EFA74F4297.pygtex ├── 71C86883E04E1103EA1641326F558904436CC55A49B9FE23533C6D51DD6F7CEF.pygtex ├── 71F022EE06D058205CA061A242E28D9DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 72501F90F591455E047586FD4D863F60ACAB352BE844810BC41017F0A898520C.pygtex ├── 727412CA8801350224218BCD5D940B06BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 741C1281F25989308AF2DF24EDF5FE45667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 749B88298A3C140266583AAFB7B1C4F6013B6262048EA690AC629EAC4C665E46.pygtex ├── 766D6E3C9EDCE7D2C7B2C90498EDC09CCBFAFB14C4435FCBEECB0D29CBB7CAD7.pygtex ├── 76B41A4A73046072644131B3785FA4E89ACBDB62FE1C9387F4652687ADBEF3CF.pygtex ├── 77A4C8F0901DE1EC3BCA2C5A74C0ACB82B7C6FB41B957B9CD982BD53521B9A28.pygtex ├── 7978FD67DBD741E7EA5871F8976D2950667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 798FDFA05A9542B54FDD2D3C90FFEDD19DB5A2378D936803F2081C0A0A5FC20A.pygtex ├── 7A2FBED1C9F114B521FE78D5CF037C9FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 7B5F960047A5B16EB1E13D50C0EABB8ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 7B7002058E87ECD633F1F7637E9C72502F0B31DBD853ACECBF0E01C56559F63B.pygtex ├── 7C1C9E653DFB5B71EF115F65A5CEF8D3667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 7C2C0D026209FC4665FC6E34B079CF88C3E1253418DBC5D1DE020790446A9F8C.pygtex ├── 7C541B516C88817AFCDC0256050A94CABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 7C897C2167F77748644493434066AE04BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 7C9C8B4E7EA4C0F36F82FF508856235CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 7D57760F98DA104472FD2C4964A6666DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 7E15CE4F2E6A9FEA2301EBAB276865107AF691668352F6010254D55AF2EF9A29.pygtex ├── 802A1DB3AE4A356D4EB7AECF7582272FC2C4EB44205A39985C7ABB373BBFDCC3.pygtex ├── 811C75D96DB7A1C3FCF1BE7221B81D2ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 81739DF7D371793B39F4632ADBF128A6326B901E10C178D8D4909DA32A0B8B17.pygtex ├── 820AD42E3C4AFD6C185AAFCA71D93C7360C1653A5BF27245126D5E419BDFEFB0.pygtex ├── 8217771698D44EFF0C1A4876C42972C97D0CE49CE284DD252764D1090974D2C5.pygtex ├── 825306BD68F26CBE3325D824C3B20CC1BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 827CB6D7D320420411D4DB6BB24C37F71D8FE877B34AF3DB30DB3190130F559F.pygtex ├── 833A738861C6FFC808FB3F88C6FF51EEBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 836FE6809E0AFA86FD401B906511174CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 83EF4CF39934D84D2680EF83AFFA1331419C7F52CC0184153B8517AD583A75C0.pygtex ├── 8424AB987355B04D757EE2C355301D4B667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 8448E74D3FC01E777847A65CB22426A573E94DEB9508F21F983A248ED22B47B4.pygtex ├── 85116D32B4760508D2B513D0CC4B0821D2472596F6697C00DBB3B8F54B3F7541.pygtex ├── 852494A17E71F8FB7C5CE0F5F23A4B3AAD1E8FBD77A4DDF8D30DC024B66A707F.pygtex ├── 856EA6A05F6CC15C024607491336E1451E0469FFE4C36AD31BAE45BB4FA419E8.pygtex ├── 8576E3BEEACA7AC053ED858B24F83E0FC0A61D7F35A3AC82D99ECF8C4E3F5E4C.pygtex ├── 85F7973C9B716F0084DC56C5C2F760D8BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 88C8FB04AAF559D9ACA39D06603584CF4282E5974F524BD5E3FAD52DCF3CCD32.pygtex ├── 88CE0EF5136F7BC377A0EB3D430B7CA3724165040C1C1E10C117A9B372B36058.pygtex ├── 88D13E488A28D0264A5E55DB521EC6C2667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 8909499CECDA415FFB2F83B2523BCE2D744EADEFAD9767C458CCDE817C094E5E.pygtex ├── 89BF13DE0AA8C34C0E990AF8CC056234BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 89F85F7D443B737E8E22A85BFB58875FB56F6BDD5C3250CFE3634AF2C431FDD6.pygtex ├── 8A2006052E4C86E23304E00805962F56B92D80E88D2B552BE1FF7586C8226FE5.pygtex ├── 8A7C976588DD2F9BB32C6018FBC23FD92B669F9399D85A5582C6A49BD003B2B1.pygtex ├── 8AAE111CC8E3B68C77BB49CB34C44083BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 8AF8588E9D73442419BB7F85F8AA85037159A06CF66E46B90664D8110745ADE0.pygtex ├── 8AFFAE7896F230C50E7333E4E36672247348077571015ADE34E53A7D8B314AE5.pygtex ├── 8C1294719FF6CE2C155553CF8C4A992A46F34B75CC783D54108435C7EE3C6AD2.pygtex ├── 8D47F95893ED649087367C52BD32C5DE28E385990021C5216B20C00869545171.pygtex ├── 8F602FF23F48167D19AD9D0B19C65170B491D9347BA74B81A48FD8477AB170BA.pygtex ├── 8F898B22D33B4AE6B360EC4725A2D646BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 9055CC5720AE9113DD3105BB74D84AF194129C51122E39C29F1F9DE25AB4FA6B.pygtex ├── 9057F0A25694333E78EEC69CDE859DD7BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 906802E1A8BAEE8893A0355414EF2764F2D4E42AD5DA5BA1C796826181F115C4.pygtex ├── 906E11679BBBEEA2886348D34992D256BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 90C1AC80D231DE981A5ECC52E12AFD229B6C2C28FD3C7DC31C51AEA4D2F2EF03.pygtex ├── 91434689BDF8AD7D985D3725051F43D90319AE78D5BEFFA17A4837877839FE47.pygtex ├── 9181A7FCAF1A5FC2B252DCD40598A2BEBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 919000C26D646A635FA7CEE36765533327B626BD747727DB0DBA3BB2896037E4.pygtex ├── 92520A5A9CF893220B9CD447F585F144BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 92ECA54870BC0C7B6155DC2BFA066197BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 9326D9C71763AD5CC4901CDED1ADCD9DFC246B3C8CC25383818020A6C0E281B8.pygtex ├── 93402A308CBEF37100968DB70CB0E0CA0AB69F981ABA18DC1375EAD946B810A9.pygtex ├── 93C90E12EE0912CDA18567BDBBBA44817E23F77288A757158DF9007A1398F469.pygtex ├── 93E4482A2A7D758A8D2ED231734B20B663FD69010ABE01DF2D3C5BFD22A30C53.pygtex ├── 93E5D1D0E8C4DA0F12F5BAE2C2FCED78BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 93EE6433D06F04CF23F9FF62C7C5E63713E8964124C0C2B488304CCF2D999835.pygtex ├── 94D0B7D63E81BB37DB36D27B1CE24D7E2F517D002F041D14E8103FF6547B11CB.pygtex ├── 95821B29FAB6835B107C35A2B3C2E28D761EED46561D9537C9E74AEE103A8498.pygtex ├── 9613BADB8999AEAEF90FCFC84F733670BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 969D7B58697ABE64C80242FC8AA3FF32BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 986F7837DD3B54C3C7021A4812F87A9F21313331BA48C781FAD97B54544FE32B.pygtex ├── 98E10EF0629AAD67C3C823FCA9E42A7022008199731E4D772CDD92003133370A.pygtex ├── 98F4E38E082959BE700B1F6BDDDE3D050E48AC72790D7CC51396B40BE938AF46.pygtex ├── 9A2CF609077876D553FDE79850D0A49FEB0AC5F9BD657AEB6C944F5BA2325D01.pygtex ├── 9A90F13A42694D1E8B2E8A31477C2F44BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 9AC56E134F699A869B8B626A5C324F5FFFC6055F8EFC062E82FB14CD9D4DA146.pygtex ├── 9AD91697E8B95CAAE4D939CD652E49577A737A8FF6C6348B197AF54222167031.pygtex ├── 9BA8A52BFB6A68CDF36452F88DACE79A75AB0A137217CEE0FF817B667ACCB051.pygtex ├── 9BCE42517E4EAE6A0BA1B66C16665195BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 9BF0EC3BFBC5AD83529E5B05CA082162BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── 9C0AEBB133D601AE004D43C19A16B0A4667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 9CBACFA12B2AE7D4089CF6420496E340D5B5EC4FC029677601B64AB36BCC9522.pygtex ├── 9D13BB710F3F009CAFB8A3C737DB3726667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 9D4D6AC2E56C3D29B94180F0D8D380FA77D27C4D0122FA087EB4B88A74A8FE15.pygtex ├── 9D9B73E40C0CDAA1C76D86B0588CCF2092164DEB65FC0D883381106598362616.pygtex ├── 9E90157DC377C9DA58C1F0CC8852CF5D667F079DA6824D8D6F61BB5D872BA319.pygtex ├── 9F67A805E8F35BC6BBE1068E14C76566811EA38BB6AF5F136BE5C5B0F0AB2290.pygtex ├── A09081292C4CB2FCFF4B9023D3131E770BCC354EB5B4C08FE54C813077B17D18.pygtex ├── A0EC54A217DA26DC44360DEC855A9F3C8674BDBCE51E2DCBC42BE928A2CCA760.pygtex ├── A0EFF0DAD4E06565647B95526DCF08B03264F5030662F1AEFDB80E787205DC64.pygtex ├── A22AAD1565104CEA1367161C348E3433BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── A24D371361675BA9B5AF534F6A4C2BCC743756BC0CBF2B40BF0B76485EDCEC6D.pygtex ├── A35941023D46A76B821CAE0BDE70A7BBBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── A4E2DA897A4093C2100C9332FADAD4CEBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── A5878850007DDC77BBC1FCC638F10182D502A8304FA609FCDC91AD8B7B8C8DD2.pygtex ├── A5EB1E2B24A64FE6505985FDDB746526CAD4CA75D8A119A73728B983F2D75ACF.pygtex ├── A60CA721147A010A669C33163587BF48BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── A6741475B5CB5EF4DDD8076087277482AC7517D010C800B24D480DC8B37D7390.pygtex ├── A705A55BA1991A28AE2A1FE4CC7542C5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── A7894DC4AD12196FA35D6C3F70A2A573BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── A7AAC0B7E757F6B4324EAE8D1082C13C163CC35FA8608D0137A2F4460DDB07A9.pygtex ├── A8C13BEB4B1C54709B6FEC0A93BF8989BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── A8FE800FDFCE014E69DF4F3030A72843BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── A904D0B789F6CD369ED57961049D5876C1C97C4AA9AC60115C8E5049C8E63F11.pygtex ├── A9FD1E9AD52BC321E5C3F3FCD402298BC6EB2679F8B26AC3D1E57AB6ED89F1C4.pygtex ├── AA570FF9D5AFF800CC0A6077F4A07683BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── AA7EE0CCDB5C2A4598398E413D0C62CD2CD3225BD5127854B7AD3EACDF79BEFA.pygtex ├── AB310F531A7D835A6DC3BC71E161B07723B617677C8DCB84E2399B4B15D9FC6A.pygtex ├── AB88D9D2AC21AB833CCF1804F68E746DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── AC00E95045CA3B41409A93A508EB8F84F24C7FEC903C8DEDAF30F9E4D220C0E8.pygtex ├── AC4D2C1ACEC899ECA3310A7F3FED8C075EC013BAE202183B0DE50D75936E178A.pygtex ├── AC639E414EABA1318DCAF8F22542931EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── AC8BC4A974869A1EA92B7FFC3E101BC0D7B9CD7D39199DEB4924520E75E0070B.pygtex ├── ACDF3410C2848793950A26434C1AC7EF4A3131D45A907BA3A73E460886817496.pygtex ├── AD865D2F63B9FEB2552C220385FBB7E3BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── ADE71D03BA6A0F56BEEF24D86F1A9F1ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── AE63FE997BC1B14FE785BD54CED4E3AB936072D06047E336CFEFFAF3E102936B.pygtex ├── AE69481E1421F9B585A8E506804320E03B9BC1BA9AA7565C51FD9A9E7A3CE36D.pygtex ├── AE6CB228079CC509F936D9A7D9775F3ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── AF525FD7B40E9560EF0B7E6D629F46CCC63CABBBC47D9887C22AF7BB00B2B7F5.pygtex ├── B288164F3F9AF3B0A441B83E74203ACC0DE05007BF86CFD248DE365B890CB3CA.pygtex ├── B3136A962C78ED1216A17F6C0E30B9C0BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── B36A8A3B03DA9A695C619A71ADD359ACC1B4AE34286C60B86EA3DD03A88561E6.pygtex ├── B38C70C03815B9E8F4D6662E3587E592ABEFAE0D305F4EEE180E8D4ACFDD935E.pygtex ├── B3A0C3B592D775B583368BF2E0DE60DBF7C2F09D62B63C5DCC62C8F72FECC6F3.pygtex ├── B45C2754C02D571B8087C8A7E735659DCBBA4C041F31DE56160B4060D4B7189D.pygtex ├── B4758856CAE5CC81695B50625484DEB9F6E828F105A8BC8686B58CD77B9918D6.pygtex ├── B4D250A07EEBCC81A2B6494EC7ADC7F6E2ADD28BF54A99384077521B89E42B32.pygtex ├── B58285D28E4F92151BB7C70E86E32CE3B38EB00377000B10C4DE2DF55B8D1DD5.pygtex ├── B64ABCB167A8B9DD4F282813C31AD0DA568F234770B58FC1E18F5738CF3548F5.pygtex ├── B670F2677D205A7707A00470B9DFAD98BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── B7243D2DDE379D05C7A8C86589D2251D81AF6A10865CA8A782A23491E97617FA.pygtex ├── B87967E1D0FA3ADED22B1602ADFC71E48976E5EB075A75E2EF72BA2098FFA759.pygtex ├── B8E59A7D4020792C412DA75E589FF4FC667F079DA6824D8D6F61BB5D872BA319.pygtex ├── B8F44259463BA973CF3E1AEAB44DA9B4C629D546D18AC446589B28BC2B00047E.pygtex ├── B99458291755EC217ECC885B6067171AFDBABFB6ACD6926E15D3425B41FC1747.pygtex ├── BA1F661D7EA5DF6AD15B77441B126F95BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── BBCEBEFF016F2738D83876ACB8BDDB81C5C334E0D5E4A5D2846C849D6B6C6BC2.pygtex ├── BC31641A232B78C8F1FF7DD5A1E487BF667F079DA6824D8D6F61BB5D872BA319.pygtex ├── BC6A432180E4DC0571809CC13998DD641C9A2BB354A44A5FB3094B70DC599EAA.pygtex ├── BCFCDA08AD9F404D53E6EA32E17B67663EC14EEA1F6482E5D0A155765CBE0A69.pygtex ├── BD3CA76A8EADDA32E771D47415F58A77BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── BD76552563866F784861E636ABDB9A59BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── BEAEF7F073D21B30C8B140642CC6B0AC9130DF13A2074F62076BE3B871566A22.pygtex ├── BF9D045328636A5DD42599C6F3889217BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── C07680CAB7F706872270DB7ED54EA6CCBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── C09B5CBB09E75FF7D789FD2F144981D06B33FB19F71663207EE4832F6D5082C1.pygtex ├── C0CAE7DA50B99B010246F50EE99C188E63B887F18B407901AC57DAF30BFA2F8B.pygtex ├── C0E4AF468ADC5440F55B15271DC86B44D47A7815ADB74A0951E0367F99A5A794.pygtex ├── C10460318CFBE838A060B653D54DA4C2C82AC48D16552D7FAD92F3A88D5906CE.pygtex ├── C1A0B4E21BA1A5892F40AB1F70C5AB6CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── C3CFF95CB583D21C6F4F145985E038BF02EB8C187DFE1000C1E77360F4B9897D.pygtex ├── C3D05138C3476BE4CFCF6B9D5243AA0D8DBD83718681A05E9AFE33D521041BDB.pygtex ├── C3E197B0D0A81DCEE337613BD449B32F71A292D141161082914AA9A0891B0B49.pygtex ├── C3E3FD80C98186CC8AE9AF8F8344AED4F4415BD19FE853ABDC5090ADD582CFF5.pygtex ├── C3FA58403F108BE3AAC17378E80C89FFFECC63A81388F2110E746A9129FEC4A9.pygtex ├── C49767F285C521847716448736DFF465BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── C4ABBFDAA75314C9F1178B5C855C1C1FE7A3BA5BF644BB3D01C45D41FBAEE238.pygtex ├── C54BDD2E5F7375244FFCC7A5A4482844667F079DA6824D8D6F61BB5D872BA319.pygtex ├── C59DBEFE384E42BE1C2A741E0AC48845F0B258A737258E038B7A2B1C8FDCFF8F.pygtex ├── C5EE5C7A9A447B0F50B618F344353510BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── C78C7BD203AC459A73BAD7B2BE5072E67BF8CD9A61A61DEE5216CDC1772A8684.pygtex ├── C7C4924E0FB06BE694345F7493E1BD536B99C75C0BDB7E6F914DA6F0B055422B.pygtex ├── C8A4700A20A1A0FAC6CDC1AC74FCCCCA0A84BF84212F1BFD20404FFD5C287E2D.pygtex ├── C8CD874A88CEA198A5781F0E9BB05358BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── C9965039A6E110B6407C9FAEE655D81216F27AD02C767B2B9C7E7FDC76FC9D4B.pygtex ├── C9B1CA13C1118CBA8A322599EC7A30BBBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── CA3509477F7FE2C1B5F35409FEE51E14BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── CAF1376154174B23D974824D86D554906BD8B41DFE785DB13B0468110E73EA04.pygtex ├── CC787CE816B61108A902203A7D04667531492830CB7D40599055B2DF19B91D33.pygtex ├── CD5B406FCCC98B1C8619E4E544192519BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── CF32B80E49746F58B55CA44BCD419EC6BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── CF52F7FA422DEB8823C695CD4F50C453BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── CFA4763905175A261166210BAAEE9FC5C464C2A87B156A67705138C651668348.pygtex ├── CFA4763905175A261166210BAAEE9FC5F6505CA7079B48679579157832F572B8.pygtex ├── CFCF418B7D5362C40399AA6F67662A842CC69A0D68046B09058D53689D1E0F75.pygtex ├── CFD757DFCC8F42479ACBDC4E1457FE4307947E95C1E0F2BDB1010F930B4C1D1A.pygtex ├── D05DAC43AC7BD999DD1CC7EDAB03D8CA4277D806EC0D7FB354FE13A06FB52EAE.pygtex ├── D126AFA4A780EAD04D0CCE11931F83E7D4991ADA870C1D7F405022343EB1DBA5.pygtex ├── D2015D277CCB585C67B60A9C8E0DDB8DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── D39B961B4E40F35848A12C46489252FA3DDC969BD85CACB72942AE8564800F99.pygtex ├── D3EB1ACD7DD277446C427E0A9F06B4355A144F7C594C0578575C1B786CCAFF1A.pygtex ├── D3EB1ACD7DD277446C427E0A9F06B435DF5107D682F86D6E3426ADEFE1349639.pygtex ├── D4BC7F5FD1E06AB039ED52BC6445831B0B7F9C7E0C722F8B8C2E1E83B7FEBEFC.pygtex ├── D4C588FDAF67CC6F47C3EAAB19DF498D9B4F524E0D012B6839CF3AF179DC9150.pygtex ├── D594F1FD1A1B252F20C24A88939D0255BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── D6A79DA23A16E3BDD015B48262E8363A667F079DA6824D8D6F61BB5D872BA319.pygtex ├── D6D27018FE721C90DDDCAD4B0836358C43E6E6F2B2F4EC4E0967C23A7A260D74.pygtex ├── D74E498DD23D04EFB196AF191F6D06F0159F8201C4C7F5C084E3E21F1E8037D4.pygtex ├── D97D767627B3CFA74075811D01489354A7BF0CD51229586796971915BA343FB3.pygtex ├── DC216E397F9964479A5359E9D1AF8B607CE70DBEAC0C8408576D154BCF1FEAAA.pygtex ├── DC25D92C5726740A19088ABEDFE61B29BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── DC4CAECD4EF69E49DCEE53682A4B0A5ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── DC562CBC3CEC295C7EAE0C035766F05EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── DD0D69BD154EE80A5BEA726259494771B6F30E3775F77B6BA619C2673603F1F5.pygtex ├── DF703952D4E975DC7FD92CE9EAB1007B5F6644BE470DFC8996BC6FE8C35513CD.pygtex ├── E0E92ABB525D97B3C760121B5A23980EBBCF09E8C02FF07668C7E80EC6FAB555.pygtex ├── E0F7B771DD6FB995C4E5EF4A21B9CBF0A9E08918CA3A7F44CEEE1B20233F5FC0.pygtex ├── E2455F51B1904B886EA5A9C774B1FF4ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── E2C942ABE10BCCD8B392AAF4D7F9832FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── E2EE5A5AE927568ECE4D5C1148DCFE93BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── E306813CECDBB09F129098FC0468A6E29FB01D33B55F6202F757E72560DE2E12.pygtex ├── E389E32AB57102E0D65D3D49E4245823321BC6C7FA0E5F1DE2708683C92BD0CD.pygtex ├── E3B3B797E825EC583097D6C404F79B4F667F079DA6824D8D6F61BB5D872BA319.pygtex ├── E3CCDAE0D80B0EA4AADD54D46C0E32CD842C68669EBB9E4ADD94C73F02A05C3C.pygtex ├── E431C0716722A1F8BCE45826B7981DCF450628C51D4C08590708CCEAAABDFC95.pygtex ├── E63005A8E63E70EB40DF9DEF567EAA483B0E41EF1C054E053E8BB2A20078EB9E.pygtex ├── E734A88A1110FA3D657454B2DD348822BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── E829360638D19026C1D4417A70AE910F0CE55161B5FDB842D8190F11D8598318.pygtex ├── E89AC3F1C663D8A50142B179FD7EC1AAB41DB62147A2A02D366F17F817CD6832.pygtex ├── E8FF5524FC974B79826EED87E69E7697698B654DE5AB7188A44D48FF514A8F91.pygtex ├── EA19432A3765C6D2603AD5442E304DE3BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── EBA859330E4685C5939C40C5FCCC0487BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── EC46F08B903F03C1BB4C0F2BF028D59C29920C14553EB73F2C194C2941E37859.pygtex ├── EC48E601DBC3698244072E693288E15E9CB0C1C7DCD0FD0B926F8A9E064D87C7.pygtex ├── ECB009A8395C0C1198B050664AE1CD27BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── ECB5337FB8C4FDC6DB119A95804689AE70B4C6B358F5FD7C8D8953A09607C2FE.pygtex ├── ECF5C61F18ED2BAF4B4F916066E553586708FFA97C65F79BDAE24CCA9EF325B2.pygtex ├── ED055CA2729DB2BE26CD8251331B760B3FB46D0EB4AA2CC70E93B0C747BE3406.pygtex ├── EDAE1D12AB30E2F851C0D01C8E650E8FDA1D28B4D56D9236401804C2923D70B1.pygtex ├── EE47FCA64A4F1E9CD96B97339BD37721BE341F2493D98FFA16CEE3152D72A9CE.pygtex ├── EE9F11505D0160B459A18BFC992CE4FC667F079DA6824D8D6F61BB5D872BA319.pygtex ├── EF25E829EC7D1F3EF96974DA34A2651EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── EFE7F95FE457C8FCAFDC7B33DE7A3AC3BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── EFFAAEC0C1F5D26290E601FF0AF7616F9BFD34E69585175EBA573E81962C5771.pygtex ├── EFFBF0E34CEEDB817552A11B49B8532FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── F0E97A839B4AD883A6471E2C51B01603DAEE9EB0513EF1DB8C782CE8C9C7564B.pygtex ├── F0EDCB16F293BFE3268029C695AFBEDA25C532643025B9B125B9D5FF678A265A.pygtex ├── F0FB5BB2D3BB3A9702AAA10E843F7E74667F079DA6824D8D6F61BB5D872BA319.pygtex ├── F104FAFFD8E403CC1B607A79411DA6B59D4379962789A90475E8CF3FADB2A6F0.pygtex ├── F15822CCAFB68040D4F8DBDF043B875C441E1F64989217C5937B6054245FEF4A.pygtex ├── F19920944EBAE6644E012013D38BD68F2A895DA4AB135C23BF3335070C144DFE.pygtex ├── F393EFA4D81F27CB400391A72374326585391CD1A4E158933BF3BBF63CDE6CCB.pygtex ├── F44E5FA8BB70A56D514DBCBDC7EFEFF24DDE1349A79400D8CF51D7461ADBCED5.pygtex ├── F5135FD58DB5E81453A7B6CD0D84C63BBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── F573ACDEC43A9433D8F375A133409336BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── F580E0237122A6AD718D3C3B751A1DB3F606459A1B4EB08CCCE26D37C5C83A85.pygtex ├── F5E53E37BA3E08BDA78DEB9BDBF8A9F7E9BAEACC05D8C21D17F6DAB4FD8F8528.pygtex ├── F63E3F43F9AB89BD6F0BA4F9064301CE093E8CE9438B85AE0C2B302F5EFE09A5.pygtex ├── F678B36EA8FF82358327300AD54092CD4AFFFDF6AB5FF73F2491CCBD270502FC.pygtex ├── F6D3242B4F6672AFD7F10B92E6BF3F65BC3BC48456CBA5E0E63DAFC6CEAB70BF.pygtex ├── F713586845678649E9B1D719186F33B9BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── F77CA2FA69951A2F98178B10F1D65AEC63BE6A5E53CBC2EE52F4D0831F5D1FA8.pygtex ├── F907D1D21E03B035E35CE09F94BC8BFA29F4AF8BE71443437353F39C6758B39A.pygtex ├── F9B29752B3732085DE683B0E99B0EA645D57B23C70C9FE8DB82D653EA1C32E9E.pygtex ├── FA9DD52CC9D9CA1C89662221D40E6034667F079DA6824D8D6F61BB5D872BA319.pygtex ├── FAFDEEF2FDE999FF5B77065D78549C77F4CFF3198B94A845D7E7850D38957825.pygtex ├── FB09AA137763E4531DFCD780ADCBA17FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex ├── FBC27924A036C551A0071462072C032402CD0A4B86A7E815B1E6BF509377F80F.pygtex ├── FBDBD494D5C803442D103485C8DDCC24667F079DA6824D8D6F61BB5D872BA319.pygtex ├── FC27CBF1AC4700887D145D04BF52A3AA14F1505A0782769401FC217994618DC6.pygtex ├── FC6E4AE07DDDE36FBED602805D65C22A5885583F628273E583D794FCB99AC34E.pygtex ├── FCBE883CAA993BD50FD81569F1EDD07BDF5107D682F86D6E3426ADEFE1349639.pygtex ├── FD550508FBDE3978174A698A5BCDAE685AF514500EFC49FE0A12339B906E5372.pygtex ├── FE117E734BD7B6428DF7FF5F6BA6C22B20C1F77E0754ABC3F7A4577061F760D5.pygtex ├── FE6EA44DDC1CD7D0124E296A5CA8FDF13BE7593CBF3C146498ADD8C9EBB74EA9.pygtex ├── FEC751261FF732B522A0CAABEB18839EC723FCA36400A7269D07E6808EE4AE63.pygtex ├── FFF086291CAC6159F9CB8D040E4C7463BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex └── solarized-light.pygstyle ├── code ├── .DS_Store ├── IEEE-754.rs ├── Trait1.rs ├── Trait2.rs ├── Trait3.rs ├── Trait4.rs ├── Trait5.rs ├── array.rs ├── bool-types.rs ├── borrowing-combining-note.rs ├── borrowing-combining.rs ├── borrowing-combining.shell ├── borrowing-mut-ref-err1.rs ├── borrowing-mut-ref-err1.shell ├── borrowing-mut-ref.rs ├── borrowing-simultaneous.rs ├── borrowing.rs ├── borrowing.shell ├── cargo.shell ├── cargo.toml ├── cargo3.toml ├── cargo4.toml ├── char-types.rs ├── closure.rs ├── closure1.rs ├── closure2.rs ├── closure3.rs ├── closure4.rs ├── const.rs ├── dangling-ref.rs ├── dangling-ref.shell ├── dangling-sol.rs ├── dangling.rs ├── dangling.shell ├── data-types.rs ├── documentation.rs ├── documentation2.rs ├── enum.rs ├── enum2.rs ├── enum3.rs ├── enum4.rs ├── enum5.rs ├── factory-method.rs ├── field-shorthand.rs ├── floating-types.rs ├── fn1.rs ├── fn2.rs ├── for-range.rs ├── for.rs ├── function-return.rs ├── function-return2.rs ├── function-return3.shell ├── function.rs ├── generic1.rs ├── generic2.rs ├── generic3.rs ├── generic4.rs ├── generic5.rs ├── generic6.rs ├── generic7.rs ├── generic8.rs ├── grep1.rs ├── grep1.shell ├── grep10.rs ├── grep11.rs ├── grep12.rs ├── grep13.rs ├── grep14.rs ├── grep2.rs ├── grep3.rs ├── grep4.rs ├── grep5.rs ├── grep6.rs ├── grep7.rs ├── grep8.rs ├── grep9.rs ├── hello-cargo.shell ├── hello-world-build.shell ├── hello-world-compile.shell ├── hello-world-main.rs ├── hello-world.shell ├── http1.rs ├── http1.shell ├── http10.rs ├── http11.rs ├── http12.rs ├── http13.rs ├── http14.rs ├── http15.rs ├── http16.rs ├── http17.rs ├── http18.rs ├── http19.rs ├── http2.rs ├── http3.rs ├── http4.rs ├── http5.rs ├── http6.rs ├── http7.rs ├── http8.rs ├── http9.rs ├── if-err-correct.rs ├── if-err.rs ├── if-err.shell ├── if-let.rs ├── if.rs ├── immutable-variable.rs ├── immutable-variable.shell ├── install-check.shell ├── install-uninstall.shell ├── install-update.shell ├── install.shell ├── iter1.rs ├── iter10.rs ├── iter11.rs ├── iter2.rs ├── iter3.rs ├── iter4.rs ├── iter5.rs ├── iter6.rs ├── iter7.rs ├── iter8.rs ├── iter9.rs ├── iterator.rs ├── iterator2.rs ├── iterator3.rs ├── iterator4.rs ├── iterator5.rs ├── iterator6.rs ├── iterator7.rs ├── iterator8.rs ├── lifetime.rs ├── lifetime10.rs ├── lifetime2.rs ├── lifetime2.shell ├── lifetime3.rs ├── lifetime4.rs ├── lifetime5.rs ├── lifetime5.shell ├── lifetime6.rs ├── lifetime7.rs ├── lifetime8.rs ├── lifetime9.rs ├── loop-label.rs ├── loop-return.rs ├── loop.rs ├── macro1.rs ├── macro2.rs ├── macro3.rs ├── macro4.rs ├── macro5.rs ├── macro6.rs ├── macro7.rs ├── macro8.rs ├── map.rs ├── map2.rs ├── match.rs ├── match1.rs ├── match2.rs ├── match3.rs ├── match4.rs ├── match5.rs ├── match6.rs ├── method.rs ├── module.rs ├── module10.rs ├── module11.rs ├── module12.rs ├── module13.rs ├── module14.rs ├── module2.rs ├── module3.rs ├── module4.rs ├── module5.rs ├── module6.rs ├── module7.rs ├── module8.rs ├── module9.rs ├── move-clone.rs ├── move-string.rs ├── move-string.shell ├── move.rs ├── move2.rs ├── multi-impl.rs ├── mutable-variable.rs ├── mutable-variable.shell ├── numeric-operations.rs ├── oop1.rs ├── oop2.rs ├── oop3.rs ├── oop4.rs ├── oop5.rs ├── oop6.rs ├── ownership-functions.rs ├── ownership-return.rs ├── ownership-return2.rs ├── panic.rs ├── pattern1.rs ├── pattern10.rs ├── pattern11.rs ├── pattern12.rs ├── pattern13.rs ├── pattern14.rs ├── pattern15.rs ├── pattern16.rs ├── pattern17.rs ├── pattern18.rs ├── pattern19.rs ├── pattern2.rs ├── pattern20.rs ├── pattern3.rs ├── pattern4.rs ├── pattern5.rs ├── pattern6.rs ├── pattern7.rs ├── pattern8.rs ├── pattern9.rs ├── profile.shell ├── profile2.toml ├── references.rs ├── result.rs ├── result10.rs ├── result11.rs ├── result12.rs ├── result2.rs ├── result3.rs ├── result4.rs ├── result5.rs ├── result6.rs ├── result7.rs ├── result8.rs ├── result9.rs ├── scope.rs ├── shadowing-vs-mutable-var1.rs ├── shadowing-vs-mutable-var2.rs ├── shadowing.rs ├── shadowing.shell ├── slice.rs ├── slice2.rs ├── slice2.shell ├── smart1.rs ├── smart10.rs ├── smart11.rs ├── smart12.rs ├── smart13.rs ├── smart14.rs ├── smart15.rs ├── smart16.rs ├── smart2.rs ├── smart3.rs ├── smart4.rs ├── smart5.rs ├── smart6.rs ├── smart7.rs ├── smart8.rs ├── smart8.shell ├── smart9.rs ├── statements-expressions.rs ├── string-slice.rs ├── string.rs ├── string_vec.rs ├── string_vec2.rs ├── struct-build.rs ├── struct-err.rs ├── struct-err2.shell ├── struct.rs ├── test1.rs ├── test1.shell ├── test10.rs ├── test11.rs ├── test2.rs ├── test3.rs ├── test4.rs ├── test5.rs ├── test6.rs ├── test7.rs ├── test8.rs ├── test9.rs ├── thread1.rs ├── thread2.rs ├── thread2.shell ├── thread3.rs ├── thread4.rs ├── thread5.rs ├── thread6.rs ├── thread6.shell ├── thread7.rs ├── thread8.rs ├── tuple-struct.rs ├── tuple-types.rs ├── type1.rs ├── type2.rs ├── type3.rs ├── type4.rs ├── type5.rs ├── type6.rs ├── type7.rs ├── unit-like-struct.rs ├── unsafe1.rs ├── unsafe2.rs ├── unsafe3.rs ├── unsafe4.rs ├── unsafe5.rs ├── unsafe6.rs ├── unsafe7.rs ├── unsafe8.rs ├── vector.rs ├── vector2.rs ├── vector3.rs ├── vector4.rs └── while.rs ├── img ├── .DS_Store ├── char.png ├── closure.png ├── graph.png ├── package.jpeg ├── rust-project-folder-structure.png ├── test.png ├── test2.png ├── trpl04-01.png ├── trpl04-02.png ├── trpl04-03.png ├── trpl04-04.png ├── trpl04-05.png ├── trpl04-06.png ├── trpl04-07.png ├── trpl14-01.png ├── trpl14-02.png ├── trpl15-04.png └── workspace.png ├── read.men ├── rust.aux ├── rust.log ├── rust.nav ├── rust.out ├── rust.pdf ├── rust.snm ├── rust.synctex.gz ├── rust.tex ├── rust.toc └── rust.vrb /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/.DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Learn Rust 2 | 3 | [Presentation file (Pdf)](https://github.com/YumcoderCom/learn-rust-lang/blob/main/rust.pdf) 4 | -------------------------------------------------------------------------------- /_minted-rust/025B13374B8CCC8CF79BA217AC543530419C7F52CC0184153B8517AD583A75C0.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{[package]} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/030920CD8F5EAA0153133E81C69DE489667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo run \PYGZgt{} output.txt 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/034BE177E34B6440F5D48C35FBFC54B6667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | tests/integration\PYGZus{}test.rs 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/0406306B50A51047BA52F18AB2CC9D65583E5D4CA16011270E20C3B722947CC1.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mf}{2.0}\PYG{p}{;}\PYG{+w}{ }\PYG{c+c1}{// f64} 4 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{y}: \PYG{k+kt}{f32} \PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mf}{3.0}\PYG{p}{;}\PYG{+w}{ }\PYG{c+c1}{// f32} 5 | \PYG{p}{\PYGZcb{}} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/0459587B1AD59669987C6C8DB91F2115667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | crates.io 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/0525D55B9514301FFB1A74F1B5946A69BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{l+s+sd}{//!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/0613D123FF3EFB757D6397CB9E696467BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{cargo}\PYG{+w}{ }\PYG{n}{doc}\PYG{+w}{ }\PYG{o}{\PYGZhy{}\PYGZhy{}}\PYG{n}{open}\PYG{+w}{ } 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/0669FB1192972E0FD119A954245E4F18BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{quote} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/0724CF689080945D04200DE4ACF501D9BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+s+sc}{b\PYGZsq{}A\PYGZsq{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/085F85C7DF3130C8E5F5E66D396019CCBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Option}\PYG{o}{\PYGZlt{}}\PYG{k+kt}{i8}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/0A079745EE65FA442EDB881778A3E480BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{stderr} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/0D63EE436D8BD71FC19F9061B23964D4BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{src}\PYG{o}{/}\PYG{n}{front\PYGZus{}of\PYGZus{}house}\PYG{o}{/}\PYG{n}{hosting}\PYG{o}{/}\PYG{k}{mod}\PYG{p}{.}\PYG{n}{rs} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/0DF3BF94A5077C0E4ED5168114426281BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mo}{0o77} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/11063EA59C943AF24818C484101D9013BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{FnOnce} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/11FDE18D6CE96EF37A77363E0E073491BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{src}\PYG{o}{/}\PYG{n}{front\PYGZus{}of\PYGZus{}house}\PYG{o}{/}\PYG{k}{mod}\PYG{p}{.}\PYG{n}{rs} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/130E0AC6E53F3432DE62EFB4A58B7F8DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{l+s}{\PYGZdq{}/\PYGZdq{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/152CC86959B07FC5168DF0CE7397E74A50B750D623C93026F92385CB02BF9C67.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo new hello\PYGZus{}cargo 3 | \PYGZdl{} \PYG{n+nb}{cd} hello\PYGZus{}cargo 4 | \end{Verbatim} 5 | -------------------------------------------------------------------------------- /_minted-rust/1577447EE8BA61BBCCC40673CCD1F7E2BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Option} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/1594C145D8ED01B7DA0790CE8E2CF669817E4A23C22766977F804F074B610689.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{s1}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n+nb}{String}::\PYG{n}{from}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}hello\PYGZdq{}}\PYG{p}{);} 3 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{s2}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{s1}\PYG{p}{;} 4 | 5 | \PYG{n+nf+fm}{println!}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}\PYGZob{}\PYGZcb{}, world!\PYGZdq{}}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{s1}\PYG{p}{);}\PYG{+w}{ }\PYG{c+c1}{// Error!} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/15E13B5AA27BC123EBE41C7238022419BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZam{}}\PYG{n}{T} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/1602AF8A8A70918CFBD4DD16E7FAA3B7BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{macro\PYGZus{}rules!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/1637D00CEF65B8BC499B1F2EAD71B4B4BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{foo}\PYG{o}{\PYGZlt{}\PYGZsq{}}\PYG{n+na}{a}\PYG{p}{,}\PYG{+w}{ }\PYG{o}{\PYGZsq{}}\PYG{n+na}{b}\PYG{o}{\PYGZgt{}}\PYG{p}{(}\PYG{n}{x}: \PYG{k+kp}{\PYGZam{}}\PYG{o}{\PYGZsq{}}\PYG{n+na}{a} \PYG{k+kt}{i32}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{y}: \PYG{k+kp}{\PYGZam{}}\PYG{o}{\PYGZsq{}}\PYG{n+na}{b} \PYG{k+kt}{i32}\PYG{p}{);} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/16F7381E2023A9B120A5485456415351BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kt}{str} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/17C537FBC72988FFFEBA154EFA43223ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/18325CC100E96A710BC1DF5EA2113B8583F94C8B40F8DF273EB9F9CE241066B7.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{spaces}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{} \PYGZdq{}}\PYG{p}{;} 4 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{spaces}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{spaces}\PYG{p}{.}\PYG{n}{len}\PYG{p}{();} 5 | \PYG{p}{\PYGZcb{}} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/189D70D74792DBC4B462721EB65CCD19BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb+bp}{self} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/19CF355A1FE33BFD89A18299A73F7F86BFBE258336EB5E56A554DD9A10B78B90.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} curl \PYGZhy{}\PYGZhy{}proto \PYG{l+s+s1}{\PYGZsq{}=https\PYGZsq{}} \PYGZhy{}\PYGZhy{}tlsv1.3 https://sh.rustup.rs \PYGZhy{}sSf \PYG{p}{|} sh 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/1B34B8CD4427E76BCFD58373B9284292667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nv}{\PYGZdl{}x} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/1C1FCDC9105056CAE5271F53D442A6A0835AAD90D234455A04442FA69BE04011.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{const}\PYG{+w}{ }\PYG{n}{THREE\PYGZus{}HOURS\PYGZus{}IN\PYGZus{}SECONDS}: \PYG{k+kt}{u32} \PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{60}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{l+m+mi}{60}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{l+m+mi}{3}\PYG{p}{;} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/1C80012486BFF5A84D55B45B8E8ECE9ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{println!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/1EA806FA712A9A10AADE254430D949AABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Box}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/22B43111CABC2C8F251FEC6F4C8BE95E231217E79A712A7FEE525201C77B0ADF.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZam{}}\PYG{k+kt}{i32}\PYG{+w}{ }\PYG{c+c1}{// a reference} 3 | \PYG{o}{\PYGZam{}\PYGZsq{}}\PYG{n+na}{a}\PYG{+w}{ }\PYG{k+kt}{i32}\PYG{+w}{ }\PYG{c+c1}{// a reference with an explicit lifetime} 4 | \PYG{o}{\PYGZam{}\PYGZsq{}}\PYG{n+na}{a}\PYG{+w}{ }\PYG{k}{mut}\PYG{+w}{ }\PYG{k+kt}{i32}\PYG{+w}{ }\PYG{c+c1}{// a mutable reference with an explicit lifetime} 5 | \end{Verbatim} 6 | -------------------------------------------------------------------------------- /_minted-rust/2316911A14C8D2D01A4CF835548A8FA4BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{?}\PYG{n}{Trait} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/23615653F876F6F6FF34942F655EB4A6667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{(}\PYGZdl{}\PYG{o}{)} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/298B78502EA6E83CE9E53D707FCD16B0BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Box}\PYG{o}{\PYGZlt{}}\PYG{k+kt}{str}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/2ACFF0BB09E7D2C78CB5DF746908AAB5DC61CF238EADAF487DCD3A7B0830CA7A.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{5}\PYG{p}{;} 3 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{y}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{x}\PYG{p}{;} 4 | 5 | \PYG{n+nf+fm}{println!}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}x = \PYGZob{}\PYGZcb{}, y = \PYGZob{}\PYGZcb{}\PYGZdq{}}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{x}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{y}\PYG{p}{);} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/2D477196F36D93DE966009E51A95A13FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{pub} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/2E20DEAEC0886436256F3D5534875072F3A868BFB47A6B45B1396DBC8FE053E8.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{[profile.dev]} 3 | \PYG{n}{opt\PYGZhy{}level}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{0} 4 | 5 | \PYG{k}{[profile.release]} 6 | \PYG{n}{opt\PYGZhy{}level}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{3} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/2E7F0EFE788BB9AD687981E4D40AAF28BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{l+m+mi}{57}\PYG{k}{u8} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/2F5635C49EDAE5D5A0F83F32CB153860BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZam{}}\PYG{n+nb}{String} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/2F9AB910A053CB66E0D62E8323E9F653667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo \PYG{n+nb}{test} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/30794C4B5C2C164387C7DC24C9208EA5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{format!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/30F9C22BCE775CD738828C548E795199BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{syn} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/315618E4AC2435A663736660414F2C0ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{String}::\PYG{n}{from} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/327B21B3BAC26A70C26A9B6D381C1449BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{+w}{ }\PYG{n+nb}{Box}\PYG{o}{\PYGZlt{}}\PYG{k}{dyn}\PYG{+w}{ }\PYG{n}{Error}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/344359A93E340C4388E7260B0562A44CC8963E442743AFB8DDB81B951C1A1B3F.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{some\PYGZus{}function}\PYG{o}{\PYGZlt{}}\PYG{n}{T}: \PYG{n+nc}{Display}\PYG{+w}{ }\PYG{o}{+}\PYG{+w}{ }\PYG{n+nb}{Clone}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{U}: \PYG{n+nb}{Clone} \PYG{o}{+}\PYG{+w}{ }\PYG{n}{Debug}\PYG{o}{\PYGZgt{}}\PYG{p}{(}\PYG{n}{t}: \PYG{k+kp}{\PYGZam{}}\PYG{n+nc}{T}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{u}: \PYG{k+kp}{\PYGZam{}}\PYG{n+nc}{U}\PYG{p}{)}\PYG{+w}{ }\PYGZhy{}\PYGZgt{} \PYG{k+kt}{i32} \PYG{p}{\PYGZob{}\PYGZcb{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/355868FACECDE95DB822418A42A2833EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{src}\PYG{o}{/}\PYG{n}{front\PYGZus{}of\PYGZus{}house}\PYG{p}{.}\PYG{n}{rs} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/369990B384D3CB76276C5AA5C98725C9667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | src 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/3971614FDDD0616F488467013242448ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{panic!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/3A05CFF250ECA7562796C846CE99FACCBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{HelloMacro} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/3D3DB0FEB66824438CAC2B09FC60049A667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | Rust is installed now. Great! 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/3DB4FBEA66C5571D2E5DCF9BEA4D07DBBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{s}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n+nb}{String}::\PYG{n}{from}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}hello\PYGZdq{}}\PYG{p}{);} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/3F20B861E06539F23B3AF2935665A141BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{hello\PYGZus{}macro}\PYG{+w}{ }\PYG{n}{function} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/3FC55EC19CABE5C2D41512941734C90BBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{use} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/401B30E3B8B5D629635A5C613CDB7919BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{x} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/436C5ED0EC5A08D7D0DABAE4F916E97CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Vec}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/45D34917C0A4519C762B1AC1A70DEC0CB1CA295D5D87F8D409F48723AE060FD5.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} mkdir \PYGZti{}/projects 3 | \PYGZdl{} \PYG{n+nb}{cd} \PYGZti{}/projects 4 | \PYGZdl{} mkdir hello\PYGZus{}world 5 | \PYGZdl{} \PYG{n+nb}{cd} hello\PYGZus{}world 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/49A6D2F7FFA12B8A2DC8602737377189F56057346E00B6D7BD67BF02F9DE315A.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+cp}{\PYGZsh{}[test]} 3 | \PYG{c+cp}{\PYGZsh{}[ignore]} 4 | \PYG{k}{fn} \PYG{n+nf}{expensive\PYGZus{}test}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 5 | \PYG{+w}{ }\PYG{c+c1}{// code that takes an hour to run} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/4CD3FBC7FBFF698FBF84AF4AFB8F0B1BBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{enums} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/4D1258AAF9722FAAE5D3880736694981BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{RefCell} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/4D70E93C98A3A5FF1E7E5160D909A9B9BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{next} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/4DC8884F1E08F8511F2B61493D4B6C7DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{p}{()} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/4EC086DF2EAF80EFA5E2146E611EDA38667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo publish 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/4EF71535027C2EA5EB94AA4D58753A38BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{should\PYGZus{}panic} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/4F0361C08B91250453911B4381E6C65CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kt}{i32} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/5066BBD66031ED95EAB7D3BB1E9BB3B9667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo \PYG{n+nb}{test} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/51239C0558DEC0B1465546626D4A9011BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mh}{0xff} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/513A8F0D174F0F50D73D5A904B0DDBDEBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{super}::\PYG{n}{hosting} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/5171C1BF6111942B651DB8086DFE45BC667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo build \PYGZhy{}\PYGZhy{}release 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/5298C3ED2BF8AC9BB5D0EC0C38CEA25D5A60F9C840B87143D3F83641CF42F6C6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{use}\PYG{+w}{ }\PYG{n}{rand}::\PYG{n}{Rng}\PYG{p}{;} 3 | 4 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 5 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{secret\PYGZus{}number}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{rand}::\PYG{n}{thread\PYGZus{}rng}\PYG{p}{().}\PYG{n}{gen\PYGZus{}range}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{o}{..=}\PYG{l+m+mi}{100}\PYG{p}{);} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/52B50126C3FCFBE316E9E3F71C06EA63BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZsh{}\PYG{c+cp}{\PYGZsh{}[derive]} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/52DECBEF766685AD0037EFB190C95A19BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{pub}\PYG{+w}{ }\PYG{k}{use} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/53B2C4D17C671AC290C301A22E8B9BC2BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{is\PYGZus{}ok} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/550006A52410A80746C6C37D0C800416F62F46EC8D53665D64F6C0E385FE6B9E.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{use}\PYG{+w}{ }\PYG{n}{std}::\PYG{n}{fs}::\PYG{n}{File}\PYG{p}{;} 3 | 4 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 5 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{greeting\PYGZus{}file}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{File}::\PYG{n}{open}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}hello.txt\PYGZdq{}}\PYG{p}{).}\PYG{n}{unwrap}\PYG{p}{();} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/55033C0600E163C847C9D8A6368F2AD6667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | lib.rs 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/550AD2DC9CE7C5CFF074CCCDBFB690DBBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{String} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/5677C7B2123BE8929B17D8E2AA416E45BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{..=} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/58D5D945093F09A7470F06248D2FA8F6BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{Rc}\PYG{o}{\PYGZlt{}}\PYG{k+kt}{str}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/592D385BD1B4DF83608A9A591A7E5DA5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{front\PYGZus{}of\PYGZus{}house} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/5A8D0618470CEF940045F967D9B8E887BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZam{}}\PYG{k}{mut} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/5B59D50474F73C5AA6B13265643F22B5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{foo}\PYG{o}{\PYGZlt{}\PYGZsq{}}\PYG{n+na}{a}\PYG{o}{\PYGZgt{}}\PYG{p}{(}\PYG{n}{x}: \PYG{k+kp}{\PYGZam{}}\PYG{o}{\PYGZsq{}}\PYG{n+na}{a} \PYG{k+kt}{i32}\PYG{p}{)}\PYG{+w}{ }\PYGZhy{}\PYGZgt{} \PYG{k+kp}{\PYGZam{}}\PYG{o}{\PYGZsq{}}\PYG{n+na}{a} \PYG{k+kt}{i32} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/5CFB95E79573A1E97DD44C24BEE61CF5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{hello\PYGZus{}macro\PYGZus{}derive} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/5D78ADCC366017B499CCFF33F4DE2C2EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{stdout} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/60C8387A9869783318B1E80E4D055687BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{*}\PYG{k}{mut}\PYG{+w}{ }\PYG{n}{T} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/615C7143E9136A0C618DF647FB1B2231BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Result}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{E}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/61AE434CEB8D2CBEBD5DEF1CE4ADDFF8BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{my\PYGZus{}vec}\PYG{o}{!}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m+mi}{3}\PYG{p}{];} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/61C8E67A2F99E3CE3E9E7C6F4C5D47BABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{Weak}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/61F8D2946F5FEAD34B8926302D7B3CF1D109851BE5E3445E9BCE9D3F860996AB.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} rustup self uninstall 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/62E967C71471692FBEB79DA98B992147667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nv}{\PYGZdl{}x}:expr 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/632A43372BF6CBAB37C2CD004A3BA6AA5B768BD27923C862E31511AA485FE4A5.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{pub}\PYG{+w}{ }\PYG{k}{trait}\PYG{+w}{ }\PYG{n+nb}{Iterator}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{k}{fn} \PYG{n+nf}{next}\PYG{p}{(}\PYG{o}{\PYGZam{}}\PYG{k}{mut}\PYG{+w}{ }\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{+w}{ }\PYGZhy{}\PYGZgt{} \PYG{n+nb}{Option}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}}\PYG{p}{;} 4 | \PYG{p}{\PYGZcb{}} 5 | \end{Verbatim} 6 | -------------------------------------------------------------------------------- /_minted-rust/649E3E60D6A4B7EC8469D8C5B9EAD323667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | src/lib.rs 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/67F93619795C926C8009732AA1B8084678C0CB20039E39D75CCB62BFC7E93581.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{match}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{n+nb}{None}\PYG{+w}{ }\PYG{o}{=\PYGZgt{}}\PYG{+w}{ }\PYG{n+nb}{None}\PYG{p}{,} 4 | \PYG{+w}{ }\PYG{n+nb}{Some}\PYG{p}{(}\PYG{n}{i}\PYG{p}{)}\PYG{+w}{ }\PYG{o}{=\PYGZgt{}}\PYG{+w}{ }\PYG{n+nb}{Some}\PYG{p}{(}\PYG{n}{i}\PYG{+w}{ }\PYG{o}{+}\PYG{+w}{ }\PYG{l+m+mi}{1}\PYG{p}{),} 5 | \PYG{p}{\PYGZcb{}} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/684EE9A17DE7E1A16BB57A50368F9273BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZsq{}}\PYG{n+na}{a} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/687728CEDD52EDC41B71AAAE19C70E42667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo run \PYGZhy{}\PYGZhy{} searchstring example\PYGZhy{}filename.txt 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/689B707814ADF97FB5729759D844F3A6BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{to\PYGZus{}string} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/694DC3F4B69852159C44C1912EF939D832936E40BC19E6981F878C221763C2D3.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo build 3 | Finished dev \PYG{o}{[}unoptimized + debuginfo\PYG{o}{]} target\PYG{o}{(}s\PYG{o}{)} \PYG{k}{in} \PYG{l+m}{0}.0s 4 | \PYGZdl{} cargo build \PYGZhy{}\PYGZhy{}release 5 | Finished release \PYG{o}{[}optimized\PYG{o}{]} target\PYG{o}{(}s\PYG{o}{)} \PYG{k}{in} \PYG{l+m}{0}.0s 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/696A67E9557FFD9D5BED06FAC16B865EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{MutexGuard}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/6A352A729213E27E8F49F04B36676B7A667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | rustup doc 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/6B7C4D40CF907951AAA444096A6E4B80667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | Cargo.toml 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/6B7C4D40CF907951AAA444096A6E4B80BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{Cargo}\PYG{p}{.}\PYG{n}{toml} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/6E2F2D52A25B14E2F06AC3725AAD1B50BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{add\PYGZus{}to\PYGZus{}waitlist} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/6EF0D67E7F9C9DFFF88070FFE6DB9717667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo login 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7005BA0BBCA516AD8B8C7C582B16DCA1BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZsq{}}\PYG{n+nb}{static} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7010193AF90EEEC95D63DCE1E2A168B680FCAC1D7315B1F73AEE679907922EDA.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{s}: \PYG{k+kp}{\PYGZam{}}\PYG{o}{\PYGZsq{}}\PYG{n+nb}{static} \PYG{k+kt}{str} \PYG{o}{=}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}I have a static lifetime.\PYGZdq{}}\PYG{p}{;} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/71F022EE06D058205CA061A242E28D9DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{l+m+mi}{1\PYGZus{}000} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/727412CA8801350224218BCD5D940B06BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{TokenStream} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/741C1281F25989308AF2DF24EDF5FE45667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | src/main.rs 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/77A4C8F0901DE1EC3BCA2C5A74C0ACB82B7C6FB41B957B9CD982BD53521B9A28.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{type} \PYG{n+nc}{Kilometers}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k+kt}{i32}\PYG{p}{;} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7978FD67DBD741E7EA5871F8976D2950667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo login abcdefghijklmnopqrstuvwxyz012345 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7A2FBED1C9F114B521FE78D5CF037C9FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{mut} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7B5F960047A5B16EB1E13D50C0EABB8ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{assert\PYGZus{}eq!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7C1C9E653DFB5B71EF115F65A5CEF8D3667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo \PYG{n+nb}{test} \PYGZhy{}\PYGZhy{} \PYGZhy{}\PYGZhy{}test\PYGZhy{}threads\PYG{o}{=}\PYG{l+m}{1} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7C2C0D026209FC4665FC6E34B079CF88C3E1253418DBC5D1DE020790446A9F8C.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{trait}\PYG{+w}{ }\PYG{n}{Add}\PYG{o}{\PYGZlt{}}\PYG{n}{Rhs}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n+nb+bp}{Self}\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{k}{type} \PYG{n+nc}{Output}\PYG{p}{;} 4 | 5 | \PYG{+w}{ }\PYG{k}{fn} \PYG{n+nf}{add}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{rhs}: \PYG{n+nc}{Rhs}\PYG{p}{)}\PYG{+w}{ }\PYGZhy{}\PYGZgt{} \PYG{n+nc}{Self}::\PYG{n}{Output}\PYG{p}{;} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/7C541B516C88817AFCDC0256050A94CABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{GET} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7C897C2167F77748644493434066AE04BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{main} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7C9C8B4E7EA4C0F36F82FF508856235CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{mod} \PYG{n+nn}{vegetables}\PYG{p}{;} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/7D57760F98DA104472FD2C4964A6666DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{FnMut} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/802A1DB3AE4A356D4EB7AECF7582272FC2C4EB44205A39985C7ABB373BBFDCC3.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{[workspace]} 3 | \PYG{n}{members}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{p}{[} 4 | \PYG{+w}{ }\PYG{l+s}{\PYGZdq{}adder\PYGZdq{}}\PYG{p}{,} 5 | \PYG{+w}{ }\PYG{l+s}{\PYGZdq{}add\PYGZus{}one\PYGZdq{}}\PYG{p}{,} 6 | \PYG{p}{]} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/811C75D96DB7A1C3FCF1BE7221B81D2ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Iterator} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/8217771698D44EFF0C1A4876C42972C97D0CE49CE284DD252764D1090974D2C5.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{t}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k+kc}{true}\PYG{p}{;} 4 | 5 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{f}: \PYG{k+kt}{bool} \PYG{o}{=}\PYG{+w}{ }\PYG{k+kc}{false}\PYG{p}{;}\PYG{+w}{ }\PYG{c+c1}{// with explicit type annotation} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/825306BD68F26CBE3325D824C3B20CC1BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{super} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/827CB6D7D320420411D4DB6BB24C37F71D8FE877B34AF3DB30DB3190130F559F.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo run 3 | ... 4 | \PYG{l+m}{4} \PYG{p}{|} \PYG{k}{if} number \PYG{o}{\PYGZob{}} 5 | \PYG{p}{|} \PYGZca{}\PYGZca{}\PYGZca{}\PYGZca{}\PYGZca{}\PYGZca{} expected \PYG{l+s+sb}{`}bool\PYG{l+s+sb}{`}, found integer 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/833A738861C6FFC808FB3F88C6FF51EEBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{Mutex} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/836FE6809E0AFA86FD401B906511174CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{unsafe} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/83EF4CF39934D84D2680EF83AFFA1331419C7F52CC0184153B8517AD583A75C0.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{rand}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}0.8.5\PYGZdq{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/8424AB987355B04D757EE2C355301D4B667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | tests/common.rs 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/85116D32B4760508D2B513D0CC4B0821D2472596F6697C00DBB3B8F54B3F7541.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+cp}{\PYGZsh{}[no\PYGZus{}mangle]} 3 | \PYG{k}{pub}\PYG{+w}{ }\PYG{k}{extern}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}C\PYGZdq{}}\PYG{+w}{ }\PYG{k}{fn} \PYG{n+nf}{call\PYGZus{}from\PYGZus{}c}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 4 | \PYG{+w}{ }\PYG{n+nf+fm}{println!}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Just called a Rust function from C!\PYGZdq{}}\PYG{p}{);} 5 | \PYG{p}{\PYGZcb{}} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/85F7973C9B716F0084DC56C5C2F760D8BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Some}\PYG{p}{(}\PYG{n}{Color}::\PYG{n}{Red}\PYG{p}{)} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/88D13E488A28D0264A5E55DB521EC6C2667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo new 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/89BF13DE0AA8C34C0E990AF8CC056234BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{match} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/8AAE111CC8E3B68C77BB49CB34C44083BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{*}\PYG{k}{const}\PYG{+w}{ }\PYG{n}{T} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/8F898B22D33B4AE6B360EC4725A2D646BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{T} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9057F0A25694333E78EEC69CDE859DD7BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZam{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/906E11679BBBEEA2886348D34992D256BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{FromResidual} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9181A7FCAF1A5FC2B252DCD40598A2BEBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZam{}}\PYG{k}{mut}\PYG{+w}{ }\PYG{n+nb+bp}{self} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/92520A5A9CF893220B9CD447F585F144BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{\PYGZus{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/92ECA54870BC0C7B6155DC2BFA066197BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mf}{2.0}\PYG{p}{;}\PYG{+w}{ }\PYG{c+c1}{// f64} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/93E5D1D0E8C4DA0F12F5BAE2C2FCED78BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{take} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9613BADB8999AEAEF90FCFC84F733670BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{index}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}\PYGZcb{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/969D7B58697ABE64C80242FC8AA3FF32BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{structs} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9A90F13A42694D1E8B2E8A31477C2F44BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{number}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{if}\PYG{+w}{ }\PYG{n}{condition}\PYG{+w}{ }\PYG{p}{\PYGZob{}}\PYG{+w}{ }\PYG{l+m+mi}{5}\PYG{+w}{ }\PYG{p}{\PYGZcb{}}\PYG{+w}{ }\PYG{k}{else}\PYG{+w}{ }\PYG{p}{\PYGZob{}}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}six\PYGZdq{}}\PYG{+w}{ }\PYG{p}{\PYGZcb{};} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9AC56E134F699A869B8B626A5C324F5FFFC6055F8EFC062E82FB14CD9D4DA146.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} rustc \PYGZhy{}\PYGZhy{}version 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9BCE42517E4EAE6A0BA1B66C16665195BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mb}{0b1111\PYGZus{}0000} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9BF0EC3BFBC5AD83529E5B05CA082162BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{eat\PYGZus{}at\PYGZus{}restaurant} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9C0AEBB133D601AE004D43C19A16B0A4667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZhy{}\PYGZhy{}test\PYGZhy{}threads 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9D13BB710F3F009CAFB8A3C737DB3726667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+c1}{\PYGZsh{}[ignore]} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9E90157DC377C9DA58C1F0CC8852CF5D667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo run 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/9F67A805E8F35BC6BBE1068E14C76566811EA38BB6AF5F136BE5C5B0F0AB2290.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} rustup update 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/A22AAD1565104CEA1367161C348E3433BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Result} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/A35941023D46A76B821CAE0BDE70A7BBBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{RefCell}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/A4E2DA897A4093C2100C9332FADAD4CEBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{impl} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/A60CA721147A010A669C33163587BF48BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{p}{(}\PYG{n}{a}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m+mi}{3}\PYG{p}{)} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/A6741475B5CB5EF4DDD8076087277482AC7517D010C800B24D480DC8B37D7390.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{number}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{3}\PYG{p}{;} 4 | 5 | \PYG{+w}{ }\PYG{k}{if}\PYG{+w}{ }\PYG{n}{number}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 6 | \PYG{+w}{ }\PYG{n+nf+fm}{println!}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}number was three\PYGZdq{}}\PYG{p}{);} 7 | \PYG{+w}{ }\PYG{p}{\PYGZcb{}} 8 | \PYG{p}{\PYGZcb{}} 9 | \end{Verbatim} 10 | -------------------------------------------------------------------------------- /_minted-rust/A705A55BA1991A28AE2A1FE4CC7542C5BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{add\PYGZus{}one} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/A7894DC4AD12196FA35D6C3F70A2A573BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{tsetup} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/A8C13BEB4B1C54709B6FEC0A93BF8989BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{first\PYGZus{}word}\PYG{p}{(}\PYG{n}{s}: \PYG{k+kp}{\PYGZam{}}\PYG{k+kt}{str}\PYG{p}{)}\PYG{+w}{ }\PYGZhy{}\PYGZgt{} \PYG{k+kp}{\PYGZam{}}\PYG{k+kt}{str} \PYG{p}{\PYGZob{}}\PYG{c+cm}{/*...*/}\PYG{p}{\PYGZcb{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/A8FE800FDFCE014E69DF4F3030A72843BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Option}\PYG{o}{\PYGZlt{}}\PYG{n}{thread}::\PYG{n}{JoinHandle}\PYG{o}{\PYGZlt{}}\PYG{p}{()}\PYG{o}{\PYGZgt{}\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/AA570FF9D5AFF800CC0A6077F4A07683BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Option}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/AB88D9D2AC21AB833CCF1804F68E746DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{plus\PYGZus{}one} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/AC639E414EABA1318DCAF8F22542931EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZam{}}\PYG{n+nb+bp}{self} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/AD865D2F63B9FEB2552C220385FBB7E3BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{l+m+mi}{1000} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/ADE71D03BA6A0F56BEEF24D86F1A9F1ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{RefMut}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/AE6CB228079CC509F936D9A7D9775F3ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{crate}::\PYG{n}{garden}::\PYG{n}{vegetables}::\PYG{n}{Asparagus} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/B3136A962C78ED1216A17F6C0E30B9C0BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{*} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/B4758856CAE5CC81695B50625484DEB9F6E828F105A8BC8686B58CD77B9918D6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{k}{mut}\PYG{+w}{ }\PYG{n}{spaces}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{} \PYGZdq{}}\PYG{p}{;} 4 | \PYG{+w}{ }\PYG{n}{spaces}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{spaces}\PYG{p}{.}\PYG{n}{len}\PYG{p}{();} 5 | \PYG{p}{\PYGZcb{}} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/B58285D28E4F92151BB7C70E86E32CE3B38EB00377000B10C4DE2DF55B8D1DD5.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+cp}{\PYGZsh{}[derive(HelloMacro)]} 3 | \PYG{k}{struct} \PYG{n+nc}{Pancakes}\PYG{p}{;} 4 | 5 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 6 | \PYG{+w}{ }\PYG{n}{Pancakes}::\PYG{n}{hello\PYGZus{}macro}\PYG{p}{();} 7 | \PYG{p}{\PYGZcb{}} 8 | \end{Verbatim} 9 | -------------------------------------------------------------------------------- /_minted-rust/B64ABCB167A8B9DD4F282813C31AD0DA568F234770B58FC1E18F5738CF3548F5.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{n+nf+fm}{println!}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Hello, world!\PYGZdq{}}\PYG{p}{);} 4 | \PYG{p}{\PYGZcb{}} 5 | \end{Verbatim} 6 | -------------------------------------------------------------------------------- /_minted-rust/B670F2677D205A7707A00470B9DFAD98BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{LockResult}\PYG{o}{\PYGZlt{}}\PYG{n}{MutexGuard}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/B87967E1D0FA3ADED22B1602ADFC71E48976E5EB075A75E2EF72BA2098FFA759.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{y}: \PYG{k+kt}{f32} \PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mf}{3.0}\PYG{p}{;}\PYG{+w}{ } 3 | \PYG{c+c1}{// y is variable name} 4 | \PYG{c+c1}{// f32 is IEEE\PYGZhy{}754 double precision standard variable type} 5 | \PYG{c+c1}{// 3.0 is iniatail value} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/B8E59A7D4020792C412DA75E589FF4FC667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | ls 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/BA1F661D7EA5DF6AD15B77441B126F95BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{mod} \PYG{n+nn}{garden} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/BC31641A232B78C8F1FF7DD5A1E487BF667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | Crates.io 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/BCFCDA08AD9F404D53E6EA32E17B67663EC14EEA1F6482E5D0A155765CBE0A69.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{unsafe}\PYG{+w}{ }\PYG{k}{fn} \PYG{n+nf}{dangerous}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}\PYGZcb{}} 3 | 4 | \PYG{k}{unsafe}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 5 | \PYG{+w}{ }\PYG{n}{dangerous}\PYG{p}{();} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/BD3CA76A8EADDA32E771D47415F58A77BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{mod} \PYG{n+nn}{garden}\PYG{p}{;} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/BD76552563866F784861E636ABDB9A59BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{expect} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/BF9D045328636A5DD42599C6F3889217BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{98\PYGZus{}222} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/C07680CAB7F706872270DB7ED54EA6CCBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{assert\PYGZus{}ne!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/C1A0B4E21BA1A5892F40AB1F70C5AB6CBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Fn} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/C49767F285C521847716448736DFF465BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{hello\PYGZus{}macro} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/C54BDD2E5F7375244FFCC7A5A4482844667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo \PYG{n+nb}{test} \PYGZhy{}\PYGZhy{}test integration\PYGZus{}test 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/C5EE5C7A9A447B0F50B618F344353510BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{src}\PYG{o}{/}\PYG{n}{front\PYGZus{}of\PYGZus{}house}\PYG{o}{/}\PYG{n}{hosting}\PYG{p}{.}\PYG{n}{rs} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/C8CD874A88CEA198A5781F0E9BB05358BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{\PYGZam{}}\PYG{k+kt}{str} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/C9B1CA13C1118CBA8A322599EC7A30BBBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{job}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{receiver}\PYG{p}{.}\PYG{n}{lock}\PYG{p}{().}\PYG{n}{unwrap}\PYG{p}{().}\PYG{n}{recv}\PYG{p}{().}\PYG{n}{unwrap}\PYG{p}{()} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/CA3509477F7FE2C1B5F35409FEE51E14BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{..} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/CD5B406FCCC98B1C8619E4E544192519BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{IGNORE\PYGZus{}CASE} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/CF32B80E49746F58B55CA44BCD419EC6BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{first\PYGZus{}word}\PYG{p}{(}\PYG{n}{s}: \PYG{k+kp}{\PYGZam{}}\PYG{n+nb}{String}\PYG{p}{)}\PYG{+w}{ }\PYGZhy{}\PYGZgt{} \PYG{k+kp}{\PYGZam{}}\PYG{k+kt}{str} \PYG{p}{\PYGZob{}}\PYG{c+cm}{/*...*/}\PYG{p}{\PYGZcb{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/CF52F7FA422DEB8823C695CD4F50C453BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+cp}{\PYGZsh{}[cfg(test)]} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/D2015D277CCB585C67B60A9C8E0DDB8DBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{Rc}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/D39B961B4E40F35848A12C46489252FA3DDC969BD85CACB72942AE8564800F99.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} rustc main.rs 3 | \PYGZdl{} ./main 4 | Hello, world! 5 | \end{Verbatim} 6 | -------------------------------------------------------------------------------- /_minted-rust/D4C588FDAF67CC6F47C3EAAB19DF498D9B4F524E0D012B6839CF3AF179DC9150.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo build 3 | Compiling hello\PYGZus{}cargo v0.1.0 \PYG{o}{(}file:///projects/hello\PYGZus{}cargo\PYG{o}{)} 4 | Finished dev \PYG{o}{[}unoptimized + debuginfo\PYG{o}{]} target\PYG{o}{(}s\PYG{o}{)} \PYG{k}{in} \PYG{l+m}{2}.85 secs 5 | \end{Verbatim} 6 | -------------------------------------------------------------------------------- /_minted-rust/D594F1FD1A1B252F20C24A88939D0255BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{forassert}\PYG{o}{!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/D6A79DA23A16E3BDD015B48262E8363A667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo \PYG{n+nb}{test} \PYGZhy{}\PYGZhy{} \PYGZhy{}\PYGZhy{}show\PYGZhy{}output 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/DC216E397F9964479A5359E9D1AF8B607CE70DBEAC0C8408576D154BCF1FEAAA.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{k}{loop}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 4 | \PYG{+w}{ }\PYG{n+nf+fm}{println!}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}again!\PYGZdq{}}\PYG{p}{);} 5 | \PYG{+w}{ }\PYG{p}{\PYGZcb{}} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/DC25D92C5726740A19088ABEDFE61B29BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{Ref}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{o}{\PYGZgt{}} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/DC4CAECD4EF69E49DCEE53682A4B0A5ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+cp}{\PYGZsh{}[no\PYGZus{}mangle]}\PYG{+w}{ } 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/DC562CBC3CEC295C7EAE0C035766F05EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/E2455F51B1904B886EA5A9C774B1FF4ABA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{println!}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}hello\PYGZdq{}}\PYG{p}{)} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/E2C942ABE10BCCD8B392AAF4D7F9832FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{?} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/E2EE5A5AE927568ECE4D5C1148DCFE93BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{println!}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}hello \PYGZob{}\PYGZcb{}\PYGZdq{}}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{name}\PYG{p}{)} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/E3B3B797E825EC583097D6C404F79B4F667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | main.rs 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/E734A88A1110FA3D657454B2DD348822BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{v} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/E829360638D19026C1D4417A70AE910F0CE55161B5FDB842D8190F11D8598318.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{struct} \PYG{n+nc}{AlwaysEqual}\PYG{p}{;} 3 | 4 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 5 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{subject}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{AlwaysEqual}\PYG{p}{;} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/EA19432A3765C6D2603AD5442E304DE3BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{Deref} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/EBA859330E4685C5939C40C5FCCC0487BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k+kt}{i8} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/ECB009A8395C0C1198B050664AE1CD27BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+cp}{\PYGZsh{}[derive(HelloMacro)]} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/ED055CA2729DB2BE26CD8251331B760B3FB46D0EB4AA2CC70E93B0C747BE3406.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+c1}{// data structure} 3 | \PYG{k}{pub}\PYG{+w}{ }\PYG{k}{struct} \PYG{n+nc}{AveragedCollection}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 4 | \PYG{+w}{ }\PYG{n}{list}: \PYG{n+nb}{Vec}\PYG{o}{\PYGZlt{}}\PYG{k+kt}{i32}\PYG{o}{\PYGZgt{}}\PYG{p}{,}\PYG{+w}{ }\PYG{c+c1}{// private} 5 | \PYG{+w}{ }\PYG{n}{average}: \PYG{k+kt}{f64}\PYG{p}{,}\PYG{+w}{ }\PYG{c+c1}{// private} 6 | \PYG{p}{\PYGZcb{}} 7 | \end{Verbatim} 8 | -------------------------------------------------------------------------------- /_minted-rust/EE47FCA64A4F1E9CD96B97339BD37721BE341F2493D98FFA16CEE3152D72A9CE.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo run 3 | Compiling variables v0.1.0 \PYG{o}{(}file:///projects/variables\PYG{o}{)} 4 | Finished dev \PYG{o}{[}unoptimized + debuginfo\PYG{o}{]} target\PYG{o}{(}s\PYG{o}{)} \PYG{k}{in} \PYG{l+m}{0}.30s 5 | Running \PYG{l+s+sb}{`}target/debug/variables\PYG{l+s+sb}{`} 6 | The value of x is: \PYG{l+m}{5} 7 | The value of x is: \PYG{l+m}{6} 8 | \end{Verbatim} 9 | -------------------------------------------------------------------------------- /_minted-rust/EE9F11505D0160B459A18BFC992CE4FC667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZgt{} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/EF25E829EC7D1F3EF96974DA34A2651EBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{customer} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/EFE7F95FE457C8FCAFDC7B33DE7A3AC3BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{DeriveInput}\PYG{+w}{ }\PYG{k}{struct} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/EFFAAEC0C1F5D26290E601FF0AF7616F9BFD34E69585175EBA573E81962C5771.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{bar}\PYG{p}{()}\PYG{+w}{ }\PYGZhy{}\PYGZgt{} \PYG{o}{!}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{c+c1}{// \PYGZhy{}\PYGZhy{}snip\PYGZhy{}\PYGZhy{}} 4 | \PYG{p}{\PYGZcb{}} 5 | \end{Verbatim} 6 | -------------------------------------------------------------------------------- /_minted-rust/EFFBF0E34CEEDB817552A11B49B8532FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nf+fm}{assert!} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/F0EDCB16F293BFE3268029C695AFBEDA25C532643025B9B125B9D5FF678A265A.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo \PYGZhy{}\PYGZhy{}version 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/F0FB5BB2D3BB3A9702AAA10E843F7E74667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{\PYGZdl{}()} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/F19920944EBAE6644E012013D38BD68F2A895DA4AB135C23BF3335070C144DFE.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo run 3 | Compiling variables v0.1.0 \PYG{o}{(}file:///projects/variables\PYG{o}{)} 4 | Finished dev \PYG{o}{[}unoptimized + debuginfo\PYG{o}{]} target\PYG{o}{(}s\PYG{o}{)} \PYG{k}{in} \PYG{l+m}{0}.31s 5 | Running \PYG{l+s+sb}{`}target/debug/variables\PYG{l+s+sb}{`} 6 | The value of x \PYG{k}{in} the inner scope is: \PYG{l+m}{12} 7 | The value of x is: \PYG{l+m}{6} 8 | \end{Verbatim} 9 | -------------------------------------------------------------------------------- /_minted-rust/F5135FD58DB5E81453A7B6CD0D84C63BBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{+w}{ }\PYGZhy{}\PYGZgt{} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/F573ACDEC43A9433D8F375A133409336BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n}{Cell} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/F5E53E37BA3E08BDA78DEB9BDBF8A9F7E9BAEACC05D8C21D17F6DAB4FD8F8528.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYGZdl{} cargo \PYG{n+nb}{test} 3 | ... 4 | 5 | running \PYG{l+m}{1} \PYG{n+nb}{test} 6 | \PYG{n+nb}{test} tests::it\PYGZus{}works ... ok 7 | 8 | \PYG{n+nb}{test} result: ok. \PYG{l+m}{1} passed\PYG{p}{;} \PYG{l+m}{0} failed\PYG{p}{;} \PYG{l+m}{0} ignored\PYG{p}{;} \PYG{l+m}{0} measured\PYG{p}{;} \PYG{l+m}{0} filtered out\PYG{p}{;} finished \PYG{k}{in} \PYG{l+m}{0}.00s 9 | ... 10 | \end{Verbatim} 11 | -------------------------------------------------------------------------------- /_minted-rust/F713586845678649E9B1D719186F33B9BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{n+nb}{Drop} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/FA9DD52CC9D9CA1C89662221D40E6034667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{c+c1}{\PYGZsh{}[test]} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/FAFDEEF2FDE999FF5B77065D78549C77F4CFF3198B94A845D7E7850D38957825.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{use}\PYG{+w}{ }\PYG{n}{std}::\PYG{n}{env}\PYG{p}{;} 3 | 4 | \PYG{k}{fn} \PYG{n+nf}{main}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 5 | \PYG{+w}{ }\PYG{k+kd}{let}\PYG{+w}{ }\PYG{n}{args}: \PYG{n+nb}{Vec}\PYG{o}{\PYGZlt{}}\PYG{n+nb}{String}\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{env}::\PYG{n}{args}\PYG{p}{().}\PYG{n}{collect}\PYG{p}{();} 6 | \PYG{+w}{ }\PYG{n+nf+fm}{dbg!}\PYG{p}{(}\PYG{n}{args}\PYG{p}{);} 7 | \PYG{p}{\PYGZcb{}} 8 | \end{Verbatim} 9 | -------------------------------------------------------------------------------- /_minted-rust/FB09AA137763E4531DFCD780ADCBA17FBA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{o}{?}\PYG{n+nb}{Sized} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/FBC27924A036C551A0071462072C032402CD0A4B86A7E815B1E6BF509377F80F.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{pub}\PYG{+w}{ }\PYG{k}{fn} \PYG{n+nf}{setup}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{c+c1}{// setup code specific to your library\PYGZsq{}s tests would go here} 4 | \PYG{p}{\PYGZcb{}} 5 | \end{Verbatim} 6 | -------------------------------------------------------------------------------- /_minted-rust/FBDBD494D5C803442D103485C8DDCC24667F079DA6824D8D6F61BB5D872BA319.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | cargo \PYG{n+nb}{test} \PYGZhy{}\PYGZhy{} \PYGZhy{}\PYGZhy{}ignored 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /_minted-rust/FC27CBF1AC4700887D145D04BF52A3AA14F1505A0782769401FC217994618DC6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{enum} \PYG{n+nb}{Result}\PYG{o}{\PYGZlt{}}\PYG{n}{T}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{E}\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{p}{\PYGZob{}} 3 | \PYG{+w}{ }\PYG{n+nb}{Ok}\PYG{p}{(}\PYG{n}{T}\PYG{p}{),} 4 | \PYG{+w}{ }\PYG{n+nb}{Err}\PYG{p}{(}\PYG{n}{E}\PYG{p}{),} 5 | \PYG{p}{\PYGZcb{}} 6 | \end{Verbatim} 7 | -------------------------------------------------------------------------------- /_minted-rust/FFF086291CAC6159F9CB8D040E4C7463BA5FFB870F3277695E59D5E7C5E4ACD6.pygtex: -------------------------------------------------------------------------------- 1 | \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] 2 | \PYG{k}{fn} \PYG{n+nf}{foo}\PYG{o}{\PYGZlt{}\PYGZsq{}}\PYG{n+na}{a}\PYG{o}{\PYGZgt{}}\PYG{p}{(}\PYG{n}{x}: \PYG{k+kp}{\PYGZam{}}\PYG{o}{\PYGZsq{}}\PYG{n+na}{a} \PYG{k+kt}{i32}\PYG{p}{);} 3 | \end{Verbatim} 4 | -------------------------------------------------------------------------------- /code/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/code/.DS_Store -------------------------------------------------------------------------------- /code/IEEE-754.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 0.1; 3 | let y = 0.2; 4 | let z = x + y; 5 | println!("result: {0}", z); //. 0.30000000000000004 6 | } 7 | -------------------------------------------------------------------------------- /code/Trait1.rs: -------------------------------------------------------------------------------- 1 | pub trait Summary { 2 | fn summarize(&self) -> String; 3 | } 4 | 5 | pub struct Tweet { 6 | pub username: String, 7 | pub content: String, 8 | pub reply: bool, 9 | pub retweet: bool, 10 | } 11 | 12 | impl Summary for Tweet { 13 | fn summarize(&self) -> String { 14 | format!("{}: {}", self.username, self.content) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/Trait2.rs: -------------------------------------------------------------------------------- 1 | pub trait Summary { 2 | fn summarize(&self) -> String { 3 | String::from("(Read more...)") 4 | } 5 | } 6 | 7 | pub struct NewsArticle { 8 | pub headline: String, 9 | // --snip-- 10 | } 11 | impl Summary for NewsArticle {} 12 | 13 | pub struct Tweet { 14 | pub username: String, 15 | // --snip-- 16 | } 17 | impl Summary for Tweet { 18 | fn summarize(&self) -> String { 19 | format!("{}: {}", self.username, self.content) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/Trait3.rs: -------------------------------------------------------------------------------- 1 | pub fn notify(item: &impl Summary) { 2 | println!("Breaking news! {}", item.summarize()); 3 | } 4 | // The impl Trait syntax works for straightforward cases but is actually syntax sugar for a longer form known as a trait bound; it looks like this: 5 | pub fn notify(item: &T) { 6 | println!("Breaking news! {}", item.summarize()); 7 | } 8 | 9 | // Specifying Multiple Trait Bounds with the + Syntax 10 | pub fn notify(item: &(impl Summary + Display)) {} 11 | // The + syntax is also valid with trait bounds on generic types: 12 | pub fn notify(item: &T) {} 13 | -------------------------------------------------------------------------------- /code/Trait4.rs: -------------------------------------------------------------------------------- 1 | fn some_function(t: &T, u: &U) -> i32 {} 2 | -------------------------------------------------------------------------------- /code/Trait5.rs: -------------------------------------------------------------------------------- 1 | fn some_function(t: &T, u: &U) -> i32 2 | where 3 | T: Display + Clone, 4 | U: Clone + Debug, 5 | { -------------------------------------------------------------------------------- /code/array.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = [1, 2, 3, 4, 5]; 3 | let months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; 4 | let b: [i32; 5] = [1, 2, 3, 4, 5]; // Here, i32 is the type of each element. After the semicolon, the number 5 indicates the array contains five elements 5 | let first = a[0]; 6 | let second = a[1]; 7 | } 8 | -------------------------------------------------------------------------------- /code/bool-types.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let t = true; 3 | 4 | let f: bool = false; // with explicit type annotation 5 | } 6 | -------------------------------------------------------------------------------- /code/borrowing-combining-note.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s = String::from("hello"); 3 | 4 | let r1 = &s; // no problem 5 | let r2 = &s; // no problem 6 | println!("{} and {}", r1, r2); 7 | // variables r1 and r2 will not be used after this point 8 | 9 | let r3 = &mut s; // no problem 10 | println!("{}", r3); 11 | } 12 | -------------------------------------------------------------------------------- /code/borrowing-combining.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s = String::from("hello"); 3 | 4 | let r1 = &s; // no problem 5 | let r2 = &s; // no problem 6 | let r3 = &mut s; // BIG PROBLEM 7 | 8 | println!("{}, {}, and {}", r1, r2, r3); 9 | } 10 | -------------------------------------------------------------------------------- /code/borrowing-mut-ref-err1.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s = String::from("hello"); 3 | 4 | let r1 = &mut s; 5 | let r2 = &mut s; 6 | 7 | println!("{}, {}", r1, r2); 8 | } 9 | -------------------------------------------------------------------------------- /code/borrowing-mut-ref.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s = String::from("hello"); 3 | 4 | change(&mut s); 5 | } 6 | 7 | fn change(some_string: &mut String) { 8 | some_string.push_str(", world"); 9 | } 10 | -------------------------------------------------------------------------------- /code/borrowing-simultaneous.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s = String::from("hello"); 3 | 4 | { 5 | let r1 = &mut s; 6 | } // r1 goes out of scope here, so we can make a new reference with no problems. 7 | 8 | let r2 = &mut s; 9 | } 10 | -------------------------------------------------------------------------------- /code/borrowing.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let s = String::from("hello"); 3 | 4 | change(&s); 5 | } 6 | 7 | fn change(some_string: &String) { 8 | some_string.push_str(", world"); // Attempting to modify a borrowed value! 9 | } 10 | -------------------------------------------------------------------------------- /code/cargo.shell: -------------------------------------------------------------------------------- 1 | $ cargo --version -------------------------------------------------------------------------------- /code/cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello_cargo" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /code/cargo3.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "guessing_game" 3 | version = "0.1.0" 4 | edition = "2021" 5 | description = "A fun game where you guess what number the computer has chosen." 6 | license = "MIT OR Apache-2.0" 7 | 8 | [dependencies] -------------------------------------------------------------------------------- /code/cargo4.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "adder", 4 | "add_one", 5 | ] -------------------------------------------------------------------------------- /code/char-types.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let c = 'z'; 3 | let z: char = ''; // with explicit type annotation 4 | let heart_eyed_cat = 'x'; 5 | } 6 | -------------------------------------------------------------------------------- /code/closure1.rs: -------------------------------------------------------------------------------- 1 | let mut list = [ 2 | Rectangle { width: 10, height: 1 }, 3 | Rectangle { width: 3, height: 5 }, 4 | Rectangle { width: 7, height: 12 }, 5 | ]; 6 | 7 | list.sort_by_key(|r| r.width); -------------------------------------------------------------------------------- /code/closure2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // Because we can have multiple immutable references to list at the same time, list is still accessible from the code before the closure definition, after the closure definition but before the closure is called, and after the closure is called. 3 | let list = vec![1, 2, 3]; 4 | println!("Before defining closure: {:?}", list); 5 | 6 | let only_borrows = || println!("From closure: {:?}", list); 7 | 8 | println!("Before calling closure: {:?}", list); 9 | only_borrows(); 10 | println!("After calling closure: {:?}", list); 11 | } 12 | -------------------------------------------------------------------------------- /code/closure3.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut list = vec![1, 2, 3]; 3 | println!("Before defining closure: {:?}", list); 4 | 5 | let mut borrows_mutably = || list.push(7); 6 | 7 | borrows_mutably(); 8 | println!("After calling closure: {:?}", list); 9 | } 10 | -------------------------------------------------------------------------------- /code/closure4.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let list = vec![1, 2, 3]; 3 | println!("Before defining closure: {:?}", list); 4 | 5 | thread::spawn(move || println!("From thread: {:?}", list)) 6 | .join() 7 | .unwrap(); 8 | } 9 | -------------------------------------------------------------------------------- /code/const.rs: -------------------------------------------------------------------------------- 1 | const THREE_HOURS_IN_SECONDS: u32 = 60 * 60 * 3; 2 | -------------------------------------------------------------------------------- /code/dangling-ref.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let r; // ---------+-- 'a 3 | // | 4 | { // | 5 | let x = 5; // -+-- 'b | 6 | r = &x; // | | 7 | } // -+ | 8 | // | 9 | println!("r: {}", r); // | 10 | } // ---------+ -------------------------------------------------------------------------------- /code/dangling-ref.shell: -------------------------------------------------------------------------------- 1 | $ cargo run 2 | Compiling chapter10 v0.1.0 (file:///projects/chapter10) 3 | error[E0597]: `x` does not live long enough 4 | --> src/main.rs:6:13 5 | | 6 | 6 | r = &x; 7 | | ^^ borrowed value does not live long enough 8 | 7 | } 9 | | - `x` dropped here while still borrowed 10 | 8 | 11 | 9 | println!("r: {}", r); 12 | | - borrow later used here 13 | 14 | For more information about this error, try `rustc --explain E0597`. 15 | error: could not compile `chapter10` due to previous error -------------------------------------------------------------------------------- /code/dangling-sol.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let string = no_dangle(); 3 | } 4 | 5 | fn no_dangle() -> String { 6 | let s = String::from("hello"); 7 | 8 | s 9 | } 10 | -------------------------------------------------------------------------------- /code/dangling.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let reference_to_nothing = dangle(); 3 | } 4 | 5 | fn dangle() -> &String { 6 | // dangle returns a reference to a String 7 | let s = String::from("hello"); // s is a new String 8 | &s // we return a reference to the String, s 9 | } // Here, s goes out of scope, and is dropped. Its memory goes away. Danger! 10 | -------------------------------------------------------------------------------- /code/data-types.rs: -------------------------------------------------------------------------------- 1 | let y: f32 = 3.0; 2 | // y is variable name 3 | // f32 is IEEE-754 double precision standard variable type 4 | // 3.0 is iniatail value -------------------------------------------------------------------------------- /code/documentation.rs: -------------------------------------------------------------------------------- 1 | /// Adds one to the number given. 2 | /// 3 | /// # Examples 4 | /// 5 | /// ``` 6 | /// let arg = 5; 7 | /// let answer = my_crate::add_one(arg); 8 | /// 9 | /// assert_eq!(6, answer); 10 | /// ``` 11 | pub fn add_one(x: i32) -> i32 { 12 | x + 1 13 | } 14 | -------------------------------------------------------------------------------- /code/documentation2.rs: -------------------------------------------------------------------------------- 1 | /// Adds one to the number given. 2 | /// 3 | /// # Examples 4 | /// 5 | /// ``` 6 | /// let arg = 5; 7 | /// let answer = my_crate::add_one(arg); 8 | /// 9 | /// assert_eq!(6, answer); 10 | /// ``` 11 | pub fn add_one(x: i32) -> i32 { 12 | x + 1 13 | } 14 | -------------------------------------------------------------------------------- /code/enum.rs: -------------------------------------------------------------------------------- 1 | enum IpAddrKind { 2 | V4, 3 | V6, 4 | } 5 | let four = IpAddrKind::V4; 6 | let six = IpAddrKind::V6; 7 | 8 | fn route(ip_kind: IpAddrKind) {} 9 | route(IpAddrKind::V4); 10 | route(IpAddrKind::V6); -------------------------------------------------------------------------------- /code/enum2.rs: -------------------------------------------------------------------------------- 1 | enum IpAddr { 2 | V4(u8, u8, u8, u8), 3 | V6(String), 4 | } 5 | 6 | let home = IpAddr::V4(127, 0, 0, 1); 7 | 8 | let loopback = IpAddr::V6(String::from("::1")); -------------------------------------------------------------------------------- /code/enum3.rs: -------------------------------------------------------------------------------- 1 | enum Message { 2 | Quit, // has no data associated with it at all. 3 | Move { x: i32, y: i32 }, // has named fields like a struct does. 4 | Write(String), // includes a single String. 5 | ChangeColor(i32, i32, i32), // includes three i32 values. 6 | } 7 | 8 | // defining different kinds of struct 9 | struct QuitMessage; // unit struct 10 | struct MoveMessage { 11 | x: i32, 12 | y: i32, 13 | } 14 | struct WriteMessage(String); // tuple struct 15 | struct ChangeColorMessage(i32, i32, i32); // tuple struct 16 | -------------------------------------------------------------------------------- /code/enum4.rs: -------------------------------------------------------------------------------- 1 | enum Option { 2 | None, 3 | Some(T), 4 | } 5 | 6 | let some_number = Some(5); 7 | let some_char = Some('e'); 8 | 9 | let absent_number: Option = None; 10 | -------------------------------------------------------------------------------- /code/enum5.rs: -------------------------------------------------------------------------------- 1 | let x: i8 = 5; 2 | let y: Option = Some(5); 3 | 4 | let sum = x + y; // Error! 5 | // no implementation for `i8 + Option` 6 | // the trait `Add>` is not implemented for `i8` -------------------------------------------------------------------------------- /code/factory-method.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | struct Rectangle { 3 | width: u32, 4 | height: u32, 5 | } 6 | 7 | impl Rectangle { 8 | fn square(size: u32) -> Self { 9 | Self { 10 | width: size, 11 | height: size, 12 | } 13 | } 14 | } 15 | fn main() { 16 | let sq = Rectangle::square(3); 17 | } 18 | -------------------------------------------------------------------------------- /code/field-shorthand.rs: -------------------------------------------------------------------------------- 1 | fn build_user(email: String, username: String) -> User { 2 | User { 3 | email: email, 4 | username: username, 5 | active: true, 6 | sign_in_count: 1, 7 | } 8 | } 9 | fn build_user_shorthand(email: String, username: String) -> User { 10 | User { 11 | email, 12 | username, 13 | active: true, 14 | sign_in_count: 1, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/floating-types.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 2.0; // f64 3 | let y: f32 = 3.0; // f32 4 | } 5 | -------------------------------------------------------------------------------- /code/fn1.rs: -------------------------------------------------------------------------------- 1 | fn add_one(x: i32) -> i32 { 2 | x + 1 3 | } 4 | 5 | fn do_twice(f: fn(i32) -> i32, arg: i32) -> i32 { 6 | f(arg) + f(arg) 7 | } 8 | 9 | fn main() { 10 | let answer = do_twice(add_one, 5); 11 | 12 | println!("The answer is: {}", answer); 13 | } 14 | -------------------------------------------------------------------------------- /code/fn2.rs: -------------------------------------------------------------------------------- 1 | fn returns_closure() -> dyn Fn(i32) -> i32 { 2 | // ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 3 | |x| x + 1 4 | } 5 | 6 | // The error references the Sized trait again! Rust doesn’t know how much space it will need to store the closure. We can use a trait object: 7 | fn returns_closure() -> Box i32> { 8 | Box::new(|x| x + 1) 9 | } 10 | -------------------------------------------------------------------------------- /code/for-range.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | for number in (1..4).rev() { 3 | println!("{number}!"); 4 | } 5 | println!("LIFTOFF!!!"); 6 | } 7 | // output: 8 | // 3! 9 | // 2! 10 | // 1! 11 | // LIFTOFF!!! 12 | -------------------------------------------------------------------------------- /code/for.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = [10, 20, 30, 40, 50]; 3 | 4 | for element in a { 5 | println!("the value is: {element}"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /code/function-return.rs: -------------------------------------------------------------------------------- 1 | fn five() -> i32 { 2 | 5 // no semicolon because it’s an expression whose value we want to return 3 | } 4 | 5 | fn main() { 6 | let x = five(); 7 | 8 | println!("The value of x is: {x}"); // 6 9 | } 10 | -------------------------------------------------------------------------------- /code/function-return2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = plus_one(5); 3 | 4 | println!("The value of x is: {x}"); 5 | } 6 | 7 | fn plus_one(x: i32) -> i32 { 8 | x + 1; // remove this semicolon 9 | } 10 | -------------------------------------------------------------------------------- /code/function-return3.shell: -------------------------------------------------------------------------------- 1 | $ cargo run 2 | Compiling functions v0.1.0 (file:///projects/functions) 3 | error[E0308]: mismatched types 4 | --> src/main.rs:7:24 5 | | 6 | 7 | fn plus_one(x: i32) -> i32 { 7 | | -------- ^^^ expected `i32`, found `()` 8 | | | 9 | | implicitly returns `()` as its body has no tail or `return` expression 10 | 8 | x + 1; 11 | | - help: remove this semicolon 12 | 13 | For more information about this error, try `rustc --explain E0308`. 14 | error: could not compile `functions` due to previous error -------------------------------------------------------------------------------- /code/function.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | another_function(5); 3 | } 4 | 5 | fn another_function(x: i32) { 6 | println!("The value of x is: {x}"); 7 | } 8 | -------------------------------------------------------------------------------- /code/generic1.rs: -------------------------------------------------------------------------------- 1 | fn largest_i32(list: &[i32]) -> &i32 { 2 | let mut largest = &list[0]; 3 | 4 | for item in list { 5 | if item > largest { 6 | largest = item; 7 | } 8 | } 9 | 10 | largest 11 | } 12 | -------------------------------------------------------------------------------- /code/generic2.rs: -------------------------------------------------------------------------------- 1 | fn largest_char(list: &[char]) -> &char { 2 | let mut largest = &list[0]; 3 | 4 | for item in list { 5 | if item > largest { 6 | largest = item; 7 | } 8 | } 9 | 10 | largest 11 | } 12 | -------------------------------------------------------------------------------- /code/generic3.rs: -------------------------------------------------------------------------------- 1 | fn largest(list: &[T]) -> &T { 2 | let mut largest = &list[0]; 3 | 4 | for item in list { 5 | if item > largest { 6 | largest = item; 7 | } 8 | } 9 | 10 | largest 11 | } 12 | 13 | fn main() { 14 | let number_list = vec![34, 50, 25, 100, 65]; 15 | let result = largest(&number_list); 16 | println!("The largest number is {}", result); 17 | 18 | let char_list = vec!['y', 'm', 'a', 'q']; 19 | let result = largest(&char_list); 20 | println!("The largest char is {}", result); 21 | } 22 | -------------------------------------------------------------------------------- /code/generic4.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: T, 3 | y: T, 4 | } 5 | 6 | fn main() { 7 | let integer = Point { x: 5, y: 10 }; 8 | let float = Point { x: 1.0, y: 4.0 }; 9 | 10 | // The fields x and y must be the same type because both have the same generic data type T 11 | // let wont_work = Point { x: 5, y: 4.0 }; // expected integer, found floating-point number 12 | // struct Point { 13 | // x: T, 14 | // y: U, 15 | // } 16 | } 17 | -------------------------------------------------------------------------------- /code/generic5.rs: -------------------------------------------------------------------------------- 1 | enum Option { 2 | Some(T), 3 | None, 4 | } 5 | 6 | enum Result { 7 | Ok(T), 8 | Err(E), 9 | } 10 | -------------------------------------------------------------------------------- /code/generic7.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: X1, 3 | y: Y1, 4 | } 5 | impl Point { 6 | fn mixup(self, other: Point) -> Point { 7 | Point { 8 | x: self.x, 9 | y: other.y, 10 | } 11 | } 12 | } 13 | fn main() { 14 | let p1 = Point { x: 5, y: 10.4 }; 15 | let p2 = Point { x: "Hello", y: 'c' }; 16 | 17 | let p3 = p1.mixup(p2); 18 | 19 | println!("p3.x = {}, p3.y = {}", p3.x, p3.y); 20 | } 21 | -------------------------------------------------------------------------------- /code/generic8.rs: -------------------------------------------------------------------------------- 1 | let integer = Some(5); 2 | let float = Some(5.0); 3 | // The monomorphized version of the above code looks similar to the following (the compiler uses different names than what we’re using here for illustration): 4 | enum Option_i32 { 5 | Some(i32), 6 | None, 7 | } 8 | 9 | enum Option_f64 { 10 | Some(f64), 11 | None, 12 | } 13 | 14 | fn main() { 15 | let integer = Option_i32::Some(5); 16 | let float = Option_f64::Some(5.0); 17 | } -------------------------------------------------------------------------------- /code/grep1.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | 3 | fn main() { 4 | let args: Vec = env::args().collect(); 5 | dbg!(args); 6 | } 7 | -------------------------------------------------------------------------------- /code/grep1.shell: -------------------------------------------------------------------------------- 1 | $ cargo run -- needle haystack 2 | Compiling minigrep v0.1.0 (file:///projects/minigrep) 3 | Finished dev [unoptimized + debuginfo] target(s) in 1.57s 4 | Running `target/debug/minigrep needle haystack` 5 | [src/main.rs:5] args = [ 6 | "target/debug/minigrep", 7 | "needle", 8 | "haystack", 9 | ] -------------------------------------------------------------------------------- /code/grep10.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // --snip-- 3 | 4 | println!("Searching for {}", config.query); 5 | println!("In file {}", config.file_path); 6 | 7 | if let Err(e) = run(config) { 8 | println!("Application error: {e}"); 9 | process::exit(1); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/grep11.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | use std::fs; 3 | 4 | pub struct Config { 5 | pub query: String, 6 | pub file_path: String, 7 | } 8 | 9 | impl Config { 10 | pub fn build(args: &[String]) -> Result { 11 | // --snip-- 12 | } 13 | } 14 | 15 | pub fn run(config: Config) -> Result<(), Box> { 16 | // --snip-- 17 | } 18 | -------------------------------------------------------------------------------- /code/grep12.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::process; 3 | 4 | use minigrep::Config; 5 | 6 | fn main() { 7 | // --snip-- 8 | if let Err(e) = minigrep::run(config) { 9 | // --snip-- 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/grep13.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | // --snip-- 3 | 4 | impl Config { 5 | pub fn build(args: &[String]) -> Result { 6 | // --snip-- 7 | 8 | let ignore_case = env::var("IGNORE_CASE").is_ok(); 9 | 10 | Ok(Config { 11 | query, 12 | file_path, 13 | ignore_case, 14 | }) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/grep14.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let args: Vec = env::args().collect(); 3 | 4 | let config = Config::build(&args).unwrap_or_else(|err| { 5 | eprintln!("Problem parsing arguments: {err}"); 6 | process::exit(1); 7 | }); 8 | 9 | if let Err(e) = minigrep::run(config) { 10 | eprintln!("Application error: {e}"); 11 | process::exit(1); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/grep2.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | 3 | fn main() { 4 | let args: Vec = env::args().collect(); 5 | 6 | // TODO: add some error handling to deal with certain potential erroneous situations 7 | let query = &args[1]; 8 | let file_path = &args[2]; 9 | 10 | println!("Searching for {}", query); 11 | println!("In file {}", file_path); 12 | } 13 | -------------------------------------------------------------------------------- /code/grep3.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::fs; 3 | 4 | fn main() { 5 | // --snip-- 6 | println!("In file {}", file_path); 7 | 8 | // TODO: handling errors as well as we could 9 | let contents = fs::read_to_string(file_path).expect("Should have been able to read the file"); 10 | 11 | println!("With text:\n{contents}"); 12 | } 13 | -------------------------------------------------------------------------------- /code/grep4.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let args: Vec = env::args().collect(); 3 | 4 | let (query, file_path) = parse_config(&args); 5 | 6 | // --snip-- 7 | } 8 | 9 | fn parse_config(args: &[String]) -> (&str, &str) { 10 | let query = &args[1]; 11 | let file_path = &args[2]; 12 | 13 | (query, file_path) 14 | } 15 | -------------------------------------------------------------------------------- /code/grep5.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let args: Vec = env::args().collect(); 3 | let config = parse_config(&args); 4 | // --snip-- 5 | } 6 | 7 | struct Config { 8 | query: String, 9 | file_path: String, 10 | } 11 | fn parse_config(args: &[String]) -> Config { 12 | let query = args[1].clone(); // TODO: reduce runtime cost using Iterator next() 13 | let file_path = args[2].clone(); 14 | 15 | Config { query, file_path } 16 | } 17 | -------------------------------------------------------------------------------- /code/grep6.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let args: Vec = env::args().collect(); 3 | 4 | let config = Config::new(&args); 5 | // --snip-- 6 | } 7 | 8 | // --snip-- 9 | impl Config { 10 | fn new(args: &[String]) -> Config { 11 | let query = args[1].clone(); 12 | let file_path = args[2].clone(); 13 | 14 | Config { query, file_path } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/grep7.rs: -------------------------------------------------------------------------------- 1 | impl Config { 2 | fn build(args: &[String]) -> Result { 3 | if args.len() < 3 { 4 | return Err("not enough arguments"); 5 | } 6 | 7 | let query = args[1].clone(); 8 | let file_path = args[2].clone(); 9 | 10 | Ok(Config { query, file_path }) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/grep8.rs: -------------------------------------------------------------------------------- 1 | use std::process; 2 | 3 | fn main() { 4 | let args: Vec = env::args().collect(); 5 | 6 | let config = Config::build(&args).unwrap_or_else(|err| { 7 | println!("Problem parsing arguments: {err}"); 8 | process::exit(1); 9 | }); 10 | 11 | // --snip-- -------------------------------------------------------------------------------- /code/grep9.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // --snip-- 3 | 4 | println!("Searching for {}", config.query); 5 | println!("In file {}", config.file_path); 6 | 7 | run(config); 8 | } 9 | 10 | fn run(config: Config) -> Result<(), Box> { 11 | let contents = fs::read_to_string(config.file_path)?; 12 | 13 | println!("With text:\n{contents}"); 14 | 15 | Ok(()) 16 | } 17 | 18 | // --snip-- 19 | -------------------------------------------------------------------------------- /code/hello-cargo.shell: -------------------------------------------------------------------------------- 1 | $ cargo new hello_cargo 2 | $ cd hello_cargo -------------------------------------------------------------------------------- /code/hello-world-build.shell: -------------------------------------------------------------------------------- 1 | $ cargo build 2 | Compiling hello_cargo v0.1.0 (file:///projects/hello_cargo) 3 | Finished dev [unoptimized + debuginfo] target(s) in 2.85 secs 4 | -------------------------------------------------------------------------------- /code/hello-world-compile.shell: -------------------------------------------------------------------------------- 1 | $ rustc main.rs 2 | $ ./main 3 | Hello, world! -------------------------------------------------------------------------------- /code/hello-world-main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /code/hello-world.shell: -------------------------------------------------------------------------------- 1 | $ mkdir ~/projects 2 | $ cd ~/projects 3 | $ mkdir hello_world 4 | $ cd hello_world -------------------------------------------------------------------------------- /code/http10.rs: -------------------------------------------------------------------------------- 1 | struct Worker { 2 | id: usize, 3 | thread: thread::JoinHandle<()>, 4 | } 5 | impl Worker { 6 | fn new(id: usize, receiver: Arc>>) -> Worker { 7 | // --snip-- 8 | let thread = thread::spawn(|| { 9 | receiver; 10 | }); 11 | 12 | Worker { id, thread } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /code/http11.rs: -------------------------------------------------------------------------------- 1 | // --snip-- 2 | 3 | type Job = Box; 4 | 5 | impl ThreadPool { 6 | // --snip-- 7 | 8 | pub fn execute(&self, f: F) 9 | where 10 | F: FnOnce() + Send + 'static, 11 | { 12 | let job = Box::new(f); 13 | 14 | self.sender.send(job).unwrap(); 15 | } 16 | } 17 | 18 | // --snip-- 19 | -------------------------------------------------------------------------------- /code/http12.rs: -------------------------------------------------------------------------------- 1 | // --snip-- 2 | 3 | impl Worker { 4 | fn new(id: usize, receiver: Arc>>) -> Worker { 5 | let thread = thread::spawn(move || loop { 6 | let job = receiver.lock().unwrap().recv().unwrap(); 7 | 8 | println!("Worker {id} got a job; executing."); 9 | 10 | job(); 11 | }); 12 | 13 | Worker { id, thread } 14 | } 15 | } -------------------------------------------------------------------------------- /code/http13.rs: -------------------------------------------------------------------------------- 1 | // --snip-- 2 | 3 | impl Worker { 4 | fn new(id: usize, receiver: Arc>>) -> Worker { 5 | let thread = thread::spawn(move || { 6 | while let Ok(job) = receiver.lock().unwrap().recv() { 7 | println!("Worker {id} got a job; executing."); 8 | 9 | job(); 10 | } 11 | }); 12 | 13 | Worker { id, thread } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/http14.rs: -------------------------------------------------------------------------------- 1 | impl Drop for ThreadPool { 2 | fn drop(&mut self) { 3 | for worker in &mut self.workers { 4 | println!("Shutting down worker {}", worker.id); 5 | worker.thread.join().unwrap(); 6 | // ^^^^^^^^`worker.thread` moved due to this method call 7 | // join function takes ownership of the receiver `self`, which moves `worker.thread` 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /code/http15.rs: -------------------------------------------------------------------------------- 1 | struct Worker { 2 | id: usize, 3 | thread: Option>, // Chanage! 4 | } 5 | impl Worker { 6 | fn new(id: usize, receiver: Arc>>) -> Worker { 7 | // --snip-- 8 | Worker { 9 | id, 10 | thread: Some(thread), // Chanage! 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/http16.rs: -------------------------------------------------------------------------------- 1 | impl Drop for ThreadPool { 2 | fn drop(&mut self) { 3 | for worker in &mut self.workers { 4 | println!("Shutting down worker {}", worker.id); 5 | // Chanage! 6 | if let Some(thread) = worker.thread.take() { 7 | thread.join().unwrap(); 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/http17.rs: -------------------------------------------------------------------------------- 1 | pub struct ThreadPool { 2 | workers: Vec, 3 | sender: Option>, // Change! 4 | } 5 | // --snip-- 6 | impl ThreadPool { 7 | pub fn new(size: usize) -> ThreadPool { 8 | // --snip-- 9 | 10 | ThreadPool { 11 | workers, 12 | sender: Some(sender), // Change! 13 | } 14 | } 15 | 16 | pub fn execute(&self, f: F) 17 | where 18 | F: FnOnce() + Send + 'static, 19 | { 20 | let job = Box::new(f); 21 | 22 | self.sender.as_ref().unwrap().send(job).unwrap(); // Change! 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /code/http18.rs: -------------------------------------------------------------------------------- 1 | impl Drop for ThreadPool { 2 | fn drop(&mut self) { 3 | drop(self.sender.take()); // New! 4 | 5 | for worker in &mut self.workers { 6 | println!("Shutting down worker {}", worker.id); 7 | 8 | if let Some(thread) = worker.thread.take() { 9 | thread.join().unwrap(); 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/http19.rs: -------------------------------------------------------------------------------- 1 | impl Drop for ThreadPool { 2 | fn drop(&mut self) { 3 | drop(self.sender.take()); // New! 4 | 5 | for worker in &mut self.workers { 6 | println!("Shutting down worker {}", worker.id); 7 | 8 | if let Some(thread) = worker.thread.take() { 9 | thread.join().unwrap(); 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/http2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); 3 | 4 | for stream in listener.incoming() { 5 | let stream = stream.unwrap(); 6 | 7 | thread::spawn(|| { 8 | handle_connection(stream); 9 | }); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/http3.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); 3 | let pool = ThreadPool::new(4); 4 | 5 | for stream in listener.incoming() { 6 | let stream = stream.unwrap(); 7 | 8 | pool.execute(|| { 9 | handle_connection(stream); 10 | }); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/http4.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); 3 | let pool = ThreadPool::new(4); 4 | 5 | for stream in listener.incoming() { 6 | let stream = stream.unwrap(); 7 | 8 | pool.execute(|| { 9 | handle_connection(stream); 10 | }); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/http5.rs: -------------------------------------------------------------------------------- 1 | use std::thread; 2 | 3 | pub struct ThreadPool { 4 | threads: Vec>, 5 | } 6 | 7 | impl ThreadPool { 8 | // --snip-- 9 | pub fn new(size: usize) -> ThreadPool { 10 | assert!(size > 0); 11 | 12 | let mut threads = Vec::with_capacity(size); 13 | 14 | for _ in 0..size { 15 | // create some threads and store them in the vector 16 | } 17 | 18 | ThreadPool { threads } 19 | } 20 | // --snip-- 21 | } 22 | -------------------------------------------------------------------------------- /code/http6.rs: -------------------------------------------------------------------------------- 1 | use std::thread; 2 | pub struct ThreadPool { 3 | workers: Vec, 4 | } 5 | impl ThreadPool { 6 | // --snip-- 7 | pub fn new(size: usize) -> ThreadPool { 8 | assert!(size > 0); 9 | 10 | let mut workers = Vec::with_capacity(size); 11 | for id in 0..size { 12 | workers.push(Worker::new(id)); 13 | } 14 | 15 | ThreadPool { workers } 16 | } 17 | // --snip-- 18 | } 19 | -------------------------------------------------------------------------------- /code/http7.rs: -------------------------------------------------------------------------------- 1 | 2 | struct Worker { 3 | id: usize, 4 | thread: thread::JoinHandle<()>, 5 | } 6 | 7 | impl Worker { 8 | fn new(id: usize) -> Worker { 9 | let thread = thread::spawn(|| {}); 10 | 11 | Worker { id, thread } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/http8.rs: -------------------------------------------------------------------------------- 1 | use std::{sync::mpsc, thread}; 2 | pub struct ThreadPool { 3 | workers: Vec, 4 | sender: mpsc::Sender, 5 | } 6 | struct Job; 7 | impl ThreadPool { 8 | // --snip-- 9 | pub fn new(size: usize) -> ThreadPool { 10 | assert!(size > 0); 11 | 12 | let (sender, receiver) = mpsc::channel(); 13 | 14 | let mut workers = Vec::with_capacity(size); 15 | 16 | for id in 0..size { 17 | workers.push(Worker::new(id)); 18 | } 19 | 20 | ThreadPool { workers, sender } 21 | } 22 | // --snip-- 23 | } -------------------------------------------------------------------------------- /code/if-err-correct.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let number = 3; 3 | 4 | if number != 0 { 5 | println!("number was something other than zero"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /code/if-err.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let number = 3; 3 | 4 | if number { 5 | println!("number was three"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /code/if-err.shell: -------------------------------------------------------------------------------- 1 | $ cargo run 2 | ... 3 | 4 | if number { 4 | | ^^^^^^ expected `bool`, found integer -------------------------------------------------------------------------------- /code/if-let.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let condition = true; 3 | let number = if condition { 5 } else { 6 }; 4 | 5 | println!("The value of number is: {number}"); // 6 6 | } 7 | -------------------------------------------------------------------------------- /code/if.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let number = 6; 3 | 4 | if number % 4 == 0 { 5 | println!("number is divisible by 4"); 6 | } else if number % 3 == 0 { 7 | println!("number is divisible by 3"); 8 | } else if number % 2 == 0 { 9 | println!("number is divisible by 2"); 10 | } else { 11 | println!("number is not divisible by 4, 3, or 2"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/immutable-variable.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 5; 3 | println!("The value of x is: {x}"); 4 | x = 6; 5 | println!("The value of x is: {x}"); 6 | } 7 | -------------------------------------------------------------------------------- /code/immutable-variable.shell: -------------------------------------------------------------------------------- 1 | $ cargo run 2 | Compiling variables v0.1.0 (file:///projects/variables) 3 | error[E0384]: cannot assign twice to immutable variable `x` 4 | --> src/main.rs:4:5 5 | | 6 | 2 | let x = 5; 7 | | - 8 | | | 9 | | first assignment to `x` 10 | | help: consider making this binding mutable: `mut x` 11 | 3 | println!("The value of x is: {x}"); 12 | 4 | x = 6; 13 | | ^^^^^ cannot assign twice to immutable variable 14 | 15 | For more information about this error, try `rustc --explain E0384`. 16 | error: could not compile `variables` due to previous error -------------------------------------------------------------------------------- /code/install-check.shell: -------------------------------------------------------------------------------- 1 | $ rustc --version -------------------------------------------------------------------------------- /code/install-uninstall.shell: -------------------------------------------------------------------------------- 1 | $ rustup self uninstall -------------------------------------------------------------------------------- /code/install-update.shell: -------------------------------------------------------------------------------- 1 | $ rustup update -------------------------------------------------------------------------------- /code/install.shell: -------------------------------------------------------------------------------- 1 | $ curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh 2 | -------------------------------------------------------------------------------- /code/iter1.rs: -------------------------------------------------------------------------------- 1 | struct Counter { 2 | count: u32, 3 | } 4 | 5 | impl Counter { 6 | fn new() -> Counter { 7 | Counter { count: 0 } 8 | } 9 | } 10 | 11 | impl Iterator for Counter { 12 | type Item = u32; 13 | 14 | fn next(&mut self) -> Option { 15 | // --snip-- 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/iter10.rs: -------------------------------------------------------------------------------- 1 | impl OutlinePrint for Point {} 2 | 3 | use std::fmt; 4 | 5 | impl fmt::Display for Point { 6 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 7 | write!(f, "({}, {})", self.x, self.y) 8 | } 9 | } 10 | 11 | fn main() { 12 | let p = Point { x: 1, y: 3 }; 13 | p.outline_print(); 14 | } 15 | -------------------------------------------------------------------------------- /code/iter11.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | struct Wrapper(Vec); 4 | 5 | impl fmt::Display for Wrapper { 6 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 7 | write!(f, "[{}]", self.0.join(", ")) 8 | } 9 | } 10 | 11 | fn main() { 12 | let w = Wrapper(vec![String::from("hello"), String::from("world")]); 13 | println!("w = {}", w); 14 | } 15 | -------------------------------------------------------------------------------- /code/iter2.rs: -------------------------------------------------------------------------------- 1 | pub trait Iterator { 2 | fn next(&mut self) -> Option; 3 | } 4 | -------------------------------------------------------------------------------- /code/iter3.rs: -------------------------------------------------------------------------------- 1 | use std::ops::Add; 2 | #[derive(Debug, Copy, Clone, PartialEq)] 3 | struct Point { 4 | x: i32, 5 | y: i32, 6 | } 7 | impl Add for Point { 8 | type Output = Point; 9 | fn add(self, other: Point) -> Point { 10 | Point { 11 | x: self.x + other.x, 12 | y: self.y + other.y, 13 | } 14 | } 15 | } 16 | fn main() { 17 | assert_eq!( 18 | Point { x: 1, y: 0 } + Point { x: 2, y: 3 }, 19 | Point { x: 3, y: 3 } 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /code/iter4.rs: -------------------------------------------------------------------------------- 1 | trait Add { 2 | type Output; 3 | 4 | fn add(self, rhs: Rhs) -> Self::Output; 5 | } 6 | -------------------------------------------------------------------------------- /code/iter5.rs: -------------------------------------------------------------------------------- 1 | use std::ops::Add; 2 | 3 | struct Millimeters(u32); 4 | struct Meters(u32); 5 | 6 | impl Add for Millimeters { 7 | type Output = Millimeters; 8 | 9 | fn add(self, other: Meters) -> Millimeters { 10 | Millimeters(self.0 + (other.0 * 1000)) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/iter6.rs: -------------------------------------------------------------------------------- 1 | trait Pilot { 2 | fn fly(&self); 3 | } 4 | 5 | trait Wizard { 6 | fn fly(&self); 7 | } 8 | 9 | struct Human; 10 | impl Pilot for Human { 11 | fn fly(&self) { 12 | println!("This is your captain speaking."); 13 | } 14 | } 15 | impl Wizard for Human { 16 | fn fly(&self) { 17 | println!("Up!"); 18 | } 19 | } 20 | impl Human { 21 | fn fly(&self) { 22 | println!("*waving arms furiously*"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /code/iter7.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let person = Human; 3 | Pilot::fly(&person); // This is your captain speaking. 4 | Wizard::fly(&person); // Up! 5 | person.fly(); // *waving arms furiously* 6 | } 7 | -------------------------------------------------------------------------------- /code/iter8.rs: -------------------------------------------------------------------------------- 1 | struct Dog; 2 | impl Dog { 3 | fn baby_name() -> String { 4 | String::from("Spot") 5 | } 6 | } 7 | 8 | trait Animal { 9 | fn baby_name() -> String; 10 | } 11 | impl Animal for Dog { 12 | fn baby_name() -> String { 13 | String::from("puppy") 14 | } 15 | } 16 | 17 | fn main() { 18 | println!("A baby dog is called a {}", Dog::baby_name()); // Spot 19 | println!("A baby dog is called a {}", ::baby_name()); // puppy 20 | } 21 | -------------------------------------------------------------------------------- /code/iter9.rs: -------------------------------------------------------------------------------- 1 | trait OutlinePrint: fmt::Display { 2 | fn outline_print(&self) { 3 | let output = self.to_string(); 4 | let len = output.len(); 5 | println!("{}", "*".repeat(len + 4)); 6 | println!("*{}*", " ".repeat(len + 2)); 7 | println!("* {} *", output); 8 | println!("*{}*", " ".repeat(len + 2)); 9 | println!("{}", "*".repeat(len + 4)); 10 | } 11 | } 12 | 13 | struct Point { 14 | x: i32, 15 | y: i32, 16 | } 17 | -------------------------------------------------------------------------------- /code/iterator.rs: -------------------------------------------------------------------------------- 1 | let v1 = vec![1, 2, 3]; 2 | 3 | let v1_iter = v1.iter(); 4 | 5 | for val in v1_iter { 6 | println!("Got: {}", val); 7 | } -------------------------------------------------------------------------------- /code/iterator2.rs: -------------------------------------------------------------------------------- 1 | pub trait Iterator { 2 | type Item; 3 | 4 | fn next(&mut self) -> Option; 5 | 6 | // methods with default implementations elided 7 | } 8 | -------------------------------------------------------------------------------- /code/iterator3.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn iterator_demonstration() { 3 | let v1 = vec![1, 2, 3]; 4 | 5 | let mut v1_iter = v1.iter(); 6 | 7 | assert_eq!(v1_iter.next(), Some(&1)); 8 | assert_eq!(v1_iter.next(), Some(&2)); 9 | assert_eq!(v1_iter.next(), Some(&3)); 10 | assert_eq!(v1_iter.next(), None); 11 | } 12 | -------------------------------------------------------------------------------- /code/iterator4.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn iterator_sum() { 3 | let v1 = vec![1, 2, 3]; 4 | 5 | let v1_iter = v1.iter(); 6 | 7 | let total: i32 = v1_iter.sum(); 8 | 9 | assert_eq!(total, 6); 10 | } 11 | -------------------------------------------------------------------------------- /code/iterator5.rs: -------------------------------------------------------------------------------- 1 | let v1: Vec = vec![1, 2, 3]; 2 | 3 | let v2: Vec<_> = v1.iter().map(|x| x + 1).collect(); 4 | 5 | assert_eq!(v2, vec![2, 3, 4]); -------------------------------------------------------------------------------- /code/iterator6.rs: -------------------------------------------------------------------------------- 1 | impl Config { 2 | pub fn build(args: &[String]) -> Result { 3 | if args.len() < 3 { 4 | return Err("not enough arguments"); 5 | } 6 | 7 | let query = args[1].clone(); 8 | let file_path = args[2].clone(); 9 | 10 | let ignore_case = env::var("IGNORE_CASE").is_ok(); 11 | 12 | Ok(Config { 13 | query, 14 | file_path, 15 | ignore_case, 16 | }) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /code/iterator7.rs: -------------------------------------------------------------------------------- 1 | impl Config { 2 | pub fn build(mut args: impl Iterator) -> Result { 3 | args.next(); 4 | 5 | let query = match args.next() { 6 | Some(arg) => arg, 7 | None => return Err("Didn't get a query string"), 8 | }; 9 | 10 | let file_path = match args.next() { 11 | Some(arg) => arg, 12 | None => return Err("Didn't get a file path"), 13 | }; 14 | 15 | Ok(Config { query, file_path }) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/iterator8.rs: -------------------------------------------------------------------------------- 1 | pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { 2 | let mut results = Vec::new(); 3 | 4 | for line in contents.lines() { 5 | if line.contains(query) { 6 | results.push(line); 7 | } 8 | } 9 | 10 | results 11 | } 12 | 13 | // refactor with iterator adaptor methods 14 | pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { 15 | contents 16 | .lines() 17 | .filter(|line| line.contains(query)) 18 | .collect() 19 | } 20 | -------------------------------------------------------------------------------- /code/lifetime.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let string1 = String::from("abcd"); 3 | let string2 = "xyz"; 4 | 5 | let result = longest(string1.as_str(), string2); 6 | println!("The longest string is {}", result); 7 | } 8 | -------------------------------------------------------------------------------- /code/lifetime10.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Display; 2 | 3 | fn longest_with_an_announcement<'a, T>(x: &'a str, y: &'a str, ann: T) -> &'a str 4 | where 5 | T: Display, 6 | { 7 | println!("Announcement! {}", ann); 8 | if x.len() > y.len() { 9 | x 10 | } else { 11 | y 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/lifetime2.rs: -------------------------------------------------------------------------------- 1 | fn longest(x: &str, y: &str) -> &str { 2 | if x.len() > y.len() { 3 | x 4 | } else { 5 | y 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /code/lifetime3.rs: -------------------------------------------------------------------------------- 1 | &i32 // a reference 2 | &'a i32 // a reference with an explicit lifetime 3 | &'a mut i32 // a mutable reference with an explicit lifetime -------------------------------------------------------------------------------- /code/lifetime4.rs: -------------------------------------------------------------------------------- 1 | fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { 2 | if x.len() > y.len() { 3 | x 4 | } else { 5 | y 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /code/lifetime5.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let string1 = String::from("long string is long"); 3 | let result; 4 | { 5 | let string2 = String::from("xyz"); 6 | result = longest(string1.as_str(), string2.as_str()); 7 | } 8 | println!("The longest string is {}", result); 9 | } 10 | -------------------------------------------------------------------------------- /code/lifetime6.rs: -------------------------------------------------------------------------------- 1 | struct ImportantExcerpt<'a> { 2 | part: &'a str, 3 | } 4 | 5 | fn main() { 6 | let novel = String::from("Call me Ishmael. Some years ago..."); 7 | let first_sentence = novel.split('.').next().expect("Could not find a '.'"); 8 | let i = ImportantExcerpt { 9 | part: first_sentence, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /code/lifetime8.rs: -------------------------------------------------------------------------------- 1 | impl<'a> ImportantExcerpt<'a> { 2 | fn announce_and_return_part(&self, announcement: &str) -> &str { 3 | println!("Attention please: {}", announcement); 4 | self.part 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /code/lifetime9.rs: -------------------------------------------------------------------------------- 1 | let s: &'static str = "I have a static lifetime."; -------------------------------------------------------------------------------- /code/loop-label.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut count = 0; 3 | 'counting_up: loop { 4 | println!("count = {count}"); 5 | let mut remaining = 10; 6 | loop { 7 | println!("remaining = {remaining}"); 8 | if remaining == 9 { break;} 9 | if count == 2 { break 'counting_up; } 10 | remaining -= 1; 11 | } 12 | count += 1; 13 | } 14 | println!("End count = {count}"); // End count = 2 15 | } -------------------------------------------------------------------------------- /code/loop-return.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut counter = 0; 3 | 4 | let result = loop { 5 | counter += 1; 6 | 7 | if counter == 10 { 8 | break counter * 2; 9 | } 10 | }; 11 | 12 | println!("The result is {result}"); // 20 13 | } 14 | -------------------------------------------------------------------------------- /code/loop.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | loop { 3 | println!("again!"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /code/macro1.rs: -------------------------------------------------------------------------------- 1 | #![feature(log_syntax)] 2 | // #![feature(trace_macros)] 3 | // trace_macros!(true); 4 | 5 | #[macro_export] 6 | macro_rules! my_vec { 7 | ($( $x:expr ),*) => { 8 | { 9 | let mut temp_vec = Vec::new(); 10 | $( 11 | log_syntax!(expr=$x); // debug 12 | temp_vec.push($x); 13 | )* 14 | temp_vec 15 | } 16 | }; 17 | } 18 | fn main() { 19 | let a = my_vec!(1, 2, 3); // my_vec![1, 2, 3] or my_vec!{1, 2, 3]} 20 | dbg!(a); 21 | } 22 | -------------------------------------------------------------------------------- /code/macro2.rs: -------------------------------------------------------------------------------- 1 | macro_rules! $name { 2 | ($matcher0) => {$expansion0}; 3 | ($matcher1) => {$expansion1}; 4 | // … 5 | ($matcherN) => {$expansionN}; 6 | } -------------------------------------------------------------------------------- /code/macro3.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // let a = my_vec!(1, 2, 3); -> 3 | let a = { 4 | let mut temp_vec = Vec::new(); 5 | temp_vec.push(1); 6 | temp_vec.push(2); 7 | temp_vec.push(3); 8 | temp_vec 9 | }; 10 | dbg!(a); 11 | } 12 | -------------------------------------------------------------------------------- /code/macro4.rs: -------------------------------------------------------------------------------- 1 | #[derive(HelloMacro)] 2 | struct Pancakes; 3 | 4 | fn main() { 5 | Pancakes::hello_macro(); 6 | } -------------------------------------------------------------------------------- /code/macro6.rs: -------------------------------------------------------------------------------- 1 | // --snip-- 2 | 3 | ident: Ident { 4 | ident: "Pancakes", 5 | span: #0 bytes(95..103) 6 | }, 7 | data: Struct( 8 | DataStruct { 9 | struct_token: Struct, 10 | fields: Unit, 11 | semi_token: Some( 12 | Semi 13 | ) 14 | } 15 | ) 16 | } -------------------------------------------------------------------------------- /code/macro7.rs: -------------------------------------------------------------------------------- 1 | #[route(GET, "/")] 2 | fn index() {} 3 | 4 | #[proc_macro_attribute] 5 | pub fn route(attr: TokenStream, item: TokenStream) -> TokenStream {} 6 | -------------------------------------------------------------------------------- /code/macro8.rs: -------------------------------------------------------------------------------- 1 | let sql = sql!(SELECT * FROM posts WHERE id=1); 2 | 3 | #[proc_macro] 4 | pub fn sql(input: TokenStream) -> TokenStream { 5 | } -------------------------------------------------------------------------------- /code/map.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | let mut scores = HashMap::new(); 4 | 5 | scores.insert(String::from("Blue"), 10); 6 | scores.insert(String::from("Yellow"), 50); 7 | 8 | let team_name = String::from("Blue"); 9 | let score = scores.get(&team_name).copied().unwrap_or(0); 10 | // This program handles the Option by calling copied to get an Option rather than an Option<&i32>, then unwrap_or to set score to zero if scores doesn't have an entry for the key. 11 | 12 | for (key, value) in &scores { 13 | println!("{key}: {value}"); 14 | } -------------------------------------------------------------------------------- /code/map2.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | let field_name = String::from("Favorite color"); 4 | let field_value = String::from("Blue"); 5 | 6 | let mut map = HashMap::new(); 7 | map.insert(field_name, field_value); 8 | // field_name and field_value are invalid at this point, try using them and see what compiler error you get! -------------------------------------------------------------------------------- /code/match.rs: -------------------------------------------------------------------------------- 1 | enum Coin { 2 | Penny, 3 | Nickel, 4 | Dime, 5 | Quarter, 6 | } 7 | 8 | fn value_in_cents(coin: Coin) -> u8 { 9 | match coin { 10 | Coin::Penny => 1, 11 | Coin::Nickel => 5, 12 | Coin::Dime => 10, 13 | Coin::Quarter => 25, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/match1.rs: -------------------------------------------------------------------------------- 1 | match x { 2 | None => None, 3 | Some(i) => Some(i + 1), 4 | } -------------------------------------------------------------------------------- /code/match2.rs: -------------------------------------------------------------------------------- 1 | enum UsState { 2 | Alabama, 3 | Alaska, 4 | // --snip-- 5 | } 6 | enum Coin { 7 | Penny, 8 | Nickel, 9 | Dime, 10 | Quarter(UsState), 11 | } 12 | fn value_in_cents(coin: Coin) -> u8 { 13 | match coin { 14 | Coin::Penny => 1, 15 | Coin::Nickel => 5, 16 | Coin::Dime => 10, 17 | Coin::Quarter(state) => { 18 | println!("State quarter from {:?}!", state); 19 | 25 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /code/match3.rs: -------------------------------------------------------------------------------- 1 | fn plus_one(x: Option) -> Option { 2 | match x { 3 | None => None, 4 | Some(i) => Some(i + 1), 5 | } 6 | } 7 | 8 | let five = Some(5); 9 | let six = plus_one(five); 10 | let none = plus_one(None); -------------------------------------------------------------------------------- /code/match4.rs: -------------------------------------------------------------------------------- 1 | fn plus_one(x: Option) -> Option { 2 | match x { 3 | Some(i) => Some(i + 1), 4 | } 5 | } 6 | // Error! We didn’t handle the None case, so this code will cause a bug. Rust knows that we didn’t cover every possible case and even knows which pattern we forgot! 7 | // 3 ~ Some(i) => Some(i + 1), 8 | // 4 ~ None => todo!(), 9 | -------------------------------------------------------------------------------- /code/match5.rs: -------------------------------------------------------------------------------- 1 | let dice_roll = 9; 2 | match dice_roll { 3 | 3 => add_fancy_hat(), 4 | 7 => remove_fancy_hat(), 5 | other => move_player(other), 6 | } 7 | 8 | match dice_roll { 9 | 3 => add_fancy_hat(), 10 | 7 => remove_fancy_hat(), 11 | _ => reroll(), 12 | } -------------------------------------------------------------------------------- /code/match6.rs: -------------------------------------------------------------------------------- 1 | let config_max = Some(3u8); 2 | match config_max { 3 | Some(max) => println!("The maximum is configured to be {}", max), 4 | _ => (), 5 | } 6 | 7 | if let Some(max) = config_max { 8 | println!("The maximum is configured to be {}", max); 9 | } -------------------------------------------------------------------------------- /code/method.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | struct Rectangle { 3 | width: u32, 4 | height: u32, 5 | } 6 | impl Rectangle { 7 | fn area(&self) -> u32 { 8 | self.width * self.height 9 | } 10 | } 11 | fn main() { 12 | let rect1 = Rectangle { 13 | width: 30, 14 | height: 50, 15 | }; 16 | println!("The area of the rectangle is {} square pixels.", rect1.area()); 17 | } 18 | -------------------------------------------------------------------------------- /code/module.rs: -------------------------------------------------------------------------------- 1 | mod front_of_house { 2 | pub mod hosting { 3 | pub fn add_to_waitlist() {} // public 4 | fn private_add_to_waitlist() {} // private 5 | } 6 | } 7 | 8 | pub fn eat_at_restaurant() { 9 | // Absolute path 10 | crate::front_of_house::hosting::add_to_waitlist(); 11 | 12 | // Relative path 13 | front_of_house::hosting::add_to_waitlist(); 14 | } 15 | -------------------------------------------------------------------------------- /code/module10.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | use std::io; 3 | fn function1() -> fmt::Result { 4 | // --snip-- 5 | } 6 | fn function2() -> io::Result<()> { 7 | // --snip-- 8 | } 9 | -------------------------------------------------------------------------------- /code/module11.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Result; 2 | use std::io::Result as IoResult; 3 | 4 | fn function1() -> Result { 5 | // --snip-- 6 | } 7 | 8 | fn function2() -> IoResult<()> { 9 | // --snip-- 10 | } 11 | -------------------------------------------------------------------------------- /code/module12.rs: -------------------------------------------------------------------------------- 1 | mod front_of_house { 2 | pub mod hosting { 3 | pub fn add_to_waitlist() {} 4 | } 5 | } 6 | 7 | pub use crate::front_of_house::hosting; 8 | 9 | pub fn eat_at_restaurant() { 10 | hosting::add_to_waitlist(); 11 | } 12 | -------------------------------------------------------------------------------- /code/module13.rs: -------------------------------------------------------------------------------- 1 | use rand::Rng; 2 | 3 | fn main() { 4 | let secret_number = rand::thread_rng().gen_range(1..=100); 5 | } 6 | -------------------------------------------------------------------------------- /code/module14.rs: -------------------------------------------------------------------------------- 1 | use std::cmp::Ordering; 2 | use std::io; 3 | // we can use nested paths to bring the same items into scope in one line. 4 | use std::{cmp::Ordering, io}; 5 | 6 | use std::io; 7 | use std::io::Write; 8 | // To merge these two paths into one use statement, we can use self in the nested path 9 | use std::io::{self, Write}; 10 | 11 | // If we want to bring all public items defined in a path into scope, we can specify that path followed by the * glob operator 12 | use std::collections::*; 13 | -------------------------------------------------------------------------------- /code/module2.rs: -------------------------------------------------------------------------------- 1 | fn deliver_order() {} 2 | 3 | mod back_of_house { 4 | fn fix_incorrect_order() { 5 | cook_order(); 6 | super::deliver_order(); 7 | } 8 | 9 | fn cook_order() {} 10 | } 11 | -------------------------------------------------------------------------------- /code/module4.rs: -------------------------------------------------------------------------------- 1 | mod back_of_house { 2 | pub enum Appetizer { 3 | Soup, 4 | Salad, 5 | } 6 | } 7 | 8 | pub fn eat_at_restaurant() { 9 | let order1 = back_of_house::Appetizer::Soup; 10 | let order2 = back_of_house::Appetizer::Salad; 11 | } 12 | -------------------------------------------------------------------------------- /code/module5.rs: -------------------------------------------------------------------------------- 1 | mod front_of_house { 2 | pub mod hosting { 3 | pub fn add_to_waitlist() {} 4 | } 5 | } 6 | use crate::front_of_house::hosting; // scope: root module 7 | pub fn eat_at_restaurant() { 8 | hosting::add_to_waitlist(); 9 | } 10 | -------------------------------------------------------------------------------- /code/module6.rs: -------------------------------------------------------------------------------- 1 | mod front_of_house { 2 | pub mod hosting { 3 | pub fn add_to_waitlist() {} 4 | } 5 | } 6 | 7 | use crate::front_of_house::hosting; 8 | 9 | mod customer { 10 | pub fn eat_at_restaurant() { 11 | hosting::add_to_waitlist(); // Error! 12 | // ^^^^^^^ use of undeclared crate or module `hosting` 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /code/module7.rs: -------------------------------------------------------------------------------- 1 | mod front_of_house { 2 | pub mod hosting { 3 | pub fn add_to_waitlist() {} 4 | } 5 | } 6 | use crate::front_of_house::hosting::add_to_waitlist; 7 | pub fn eat_at_restaurant() { 8 | add_to_waitlist(); 9 | } 10 | -------------------------------------------------------------------------------- /code/module8.rs: -------------------------------------------------------------------------------- 1 | mod front_of_house { 2 | pub mod hosting { 3 | pub fn add_to_waitlist() {} 4 | } 5 | } 6 | use crate::front_of_house::hosting; // idiomatic way! 7 | pub fn eat_at_restaurant() { 8 | hosting::add_to_waitlist(); 9 | } 10 | -------------------------------------------------------------------------------- /code/module9.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | fn main() { 4 | let mut map = HashMap::new(); 5 | map.insert(1, 2); 6 | } 7 | -------------------------------------------------------------------------------- /code/move-clone.rs: -------------------------------------------------------------------------------- 1 | let s1 = String::from("hello"); 2 | let s2 = s1.clone(); 3 | 4 | println!("s1 = {}, s2 = {}", s1, s2); -------------------------------------------------------------------------------- /code/move-string.rs: -------------------------------------------------------------------------------- 1 | let s1 = String::from("hello"); 2 | let s2 = s1; 3 | 4 | println!("{}, world!", s1); // Error! -------------------------------------------------------------------------------- /code/move-string.shell: -------------------------------------------------------------------------------- 1 | $ cargo run 2 | ... 3 | error[E0382]: borrow of moved value: `s1` 4 | --> src/main.rs:5:28 5 | | 6 | 2 | let s1 = String::from("hello"); 7 | | -- move occurs because `s1` has type `String`, which does not implement the `Copy` trait 8 | 3 | let s2 = s1; 9 | | -- value moved here 10 | 4 | 11 | 5 | println!("{}, world!", s1); 12 | | ^^ value borrowed here after move 13 | | 14 | ... -------------------------------------------------------------------------------- /code/move.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 5; 3 | let y = x; 4 | func(x); // y = x, func paramater bind on stack 5 | } 6 | fn func(y: u8) { 7 | y 8 | } 9 | -------------------------------------------------------------------------------- /code/move2.rs: -------------------------------------------------------------------------------- 1 | let x = 5; 2 | let y = x; 3 | 4 | println!("x = {}, y = {}", x, y); -------------------------------------------------------------------------------- /code/multi-impl.rs: -------------------------------------------------------------------------------- 1 | impl Rectangle { 2 | fn area(&self) -> u32 { 3 | self.width * self.height 4 | } 5 | } 6 | 7 | impl Rectangle { 8 | fn can_hold(&self, other: &Rectangle) -> bool { 9 | self.width > other.width && self.height > other.height 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/mutable-variable.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut x = 5; 3 | println!("The value of x is: {x}"); 4 | x = 6; 5 | println!("The value of x is: {x}"); 6 | } 7 | -------------------------------------------------------------------------------- /code/mutable-variable.shell: -------------------------------------------------------------------------------- 1 | $ cargo run 2 | Compiling variables v0.1.0 (file:///projects/variables) 3 | Finished dev [unoptimized + debuginfo] target(s) in 0.30s 4 | Running `target/debug/variables` 5 | The value of x is: 5 6 | The value of x is: 6 -------------------------------------------------------------------------------- /code/numeric-operations.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // addition 3 | let sum = 5 + 10; 4 | 5 | // subtraction 6 | let difference = 95.5 - 4.3; 7 | 8 | // multiplication 9 | let product = 4 * 30; 10 | 11 | // division 12 | let quotient = 56.7 / 32.2; 13 | let floored = 2 / 3; // Results in 0 14 | 15 | // remainder 16 | let remainder = 43 % 5; 17 | } 18 | -------------------------------------------------------------------------------- /code/oop1.rs: -------------------------------------------------------------------------------- 1 | // data structure 2 | pub struct AveragedCollection { 3 | list: Vec, // private 4 | average: f64, // private 5 | } 6 | -------------------------------------------------------------------------------- /code/oop2.rs: -------------------------------------------------------------------------------- 1 | // procedures that operate on data structure 2 | impl AveragedCollection { 3 | // public method 4 | pub fn average(&self) -> f64 { 5 | // --- snip --- 6 | } 7 | // private method 8 | fn update_average(&mut self) { 9 | // --- snip --- 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/oop3.rs: -------------------------------------------------------------------------------- 1 | pub trait Draw { 2 | fn draw(&self); 3 | } 4 | // pub struct Screen { 5 | // // vector of trait objects (dynamic) 6 | // pub components: Vec>, 7 | // } 8 | pub struct Screen { 9 | // generic type parameter with trait bounds (static) 10 | pub components: Vec, 11 | } 12 | impl Screen 13 | where 14 | T: Draw, 15 | { 16 | pub fn run(&self) { 17 | for component in self.components.iter() { 18 | component.draw(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/oop4.rs: -------------------------------------------------------------------------------- 1 | pub struct Button { 2 | pub width: u32, 3 | pub height: u32, 4 | pub label: String, 5 | } 6 | 7 | impl Draw for Button { 8 | fn draw(&self) { 9 | // code to actually draw a button 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/oop5.rs: -------------------------------------------------------------------------------- 1 | struct SelectBox { 2 | width: u32, 3 | height: u32, 4 | options: Vec, 5 | } 6 | 7 | impl Draw for SelectBox { 8 | fn draw(&self) { 9 | // code to actually draw a select box 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/oop6.rs: -------------------------------------------------------------------------------- 1 | use gui::{Button, Screen}; 2 | fn main() { 3 | let screen = Screen { 4 | components: vec![ 5 | Box::new(SelectBox { 6 | width: 75, 7 | height: 10, 8 | options: vec![String::from("Yes"), String::from("No")], 9 | }), 10 | Box::new(Button { 11 | width: 50, 12 | height: 10, 13 | label: String::from("OK"), 14 | }), 15 | ], 16 | }; 17 | 18 | screen.run(); 19 | } 20 | -------------------------------------------------------------------------------- /code/ownership-return2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let s1 = String::from("hello"); 3 | 4 | let (s2, len) = calculate_length(s1); 5 | 6 | println!("The length of '{}' is {}.", s2, len); 7 | } 8 | 9 | fn calculate_length(s: String) -> (String, usize) { 10 | let length = s.len(); // len() returns the length of a String 11 | 12 | (s, length) 13 | } 14 | -------------------------------------------------------------------------------- /code/panic.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let v = vec![1, 2, 3]; 3 | v[99]; // panic 4 | 5 | panic!("crash and burn"); // panic macro 6 | } 7 | -------------------------------------------------------------------------------- /code/pattern1.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let favorite_color: Option<&str> = None; 3 | let is_tuesday = false; 4 | let age: Result = "34".parse(); 5 | 6 | if let Some(color) = favorite_color { 7 | println!("Using your favorite color, {color}, ..."); 8 | } else if is_tuesday { 9 | println!("Tuesday is green day!"); 10 | } else if let Ok(age) = age { 11 | if age > 30 { 12 | // --snip-- 13 | } 14 | } else { 15 | println!("Using blue as the background color"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /code/pattern10.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: i32, 3 | y: i32, 4 | } 5 | fn main() { 6 | let p = Point { x: 0, y: 7 }; 7 | let Point { x: a, y: b } = p; 8 | assert_eq!(0, a); 9 | assert_eq!(7, b); 10 | 11 | let Point { x, y } = p; // let Point { x: x, y: y } = p; 12 | match p { 13 | Point { x, y: 0 } => println!("On the x axis at {x}"), 14 | Point { x: 0, y } => println!("On the y axis at {y}"), 15 | Point { x, y } => { 16 | println!("On neither axis: ({x}, {y})"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /code/pattern12.rs: -------------------------------------------------------------------------------- 1 | enum Color { 2 | Rgb(i32, i32, i32), 3 | Hsv(i32, i32, i32), 4 | } 5 | enum Message { 6 | // ---snip--- 7 | ChangeColor(Color), 8 | } 9 | fn main() { 10 | let msg = Message::ChangeColor(Color::Hsv(0, 160, 255)); 11 | 12 | match msg { 13 | Message::ChangeColor(Color::Rgb(r, g, b)) => { 14 | println!("... red {r}, green {g}, and blue {b}"); 15 | } 16 | Message::ChangeColor(Color::Hsv(h, s, v)) => { 17 | println!("...hue {h}, saturation {s}, value {v}") 18 | } 19 | _ => (), 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /code/pattern13.rs: -------------------------------------------------------------------------------- 1 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); -------------------------------------------------------------------------------- /code/pattern14.rs: -------------------------------------------------------------------------------- 1 | fn foo(_: i32, y: i32) { 2 | println!("This code only uses the y parameter: {}", y); 3 | } 4 | 5 | fn main() { 6 | foo(3, 4); 7 | let mut setting_value = Some(5); 8 | let new_setting_value = Some(10); 9 | 10 | match (setting_value, new_setting_value) { 11 | (Some(_), Some(_)) => { 12 | println!("Can't overwrite an existing customized value"); 13 | } 14 | _ => { 15 | setting_value = new_setting_value; 16 | } 17 | } 18 | 19 | println!("setting is {:?}", setting_value); 20 | } 21 | -------------------------------------------------------------------------------- /code/pattern15.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let _x = 5; 3 | let y = 10; 4 | 5 | let s = Some(String::from("Hello!")); 6 | if let Some(_s) = s { 7 | println!("found a string"); 8 | } 9 | println!("{:?}", s); 10 | } 11 | -------------------------------------------------------------------------------- /code/pattern16.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: i32, 3 | y: i32, 4 | z: i32, 5 | } 6 | let origin = Point { x: 0, y: 0, z: 0 }; 7 | match origin { 8 | Point { x, .. } => println!("x is {}", x), 9 | } 10 | 11 | let numbers = (2, 4, 8, 16, 32); 12 | match numbers { 13 | (first, .., last) => { 14 | println!("Some numbers: {first}, {last}"); 15 | } 16 | } -------------------------------------------------------------------------------- /code/pattern17.rs: -------------------------------------------------------------------------------- 1 | let x = Some(5); 2 | let y = 10; 3 | match x { 4 | Some(50) => println!("Got 50"), 5 | Some(n) if n == y => println!("Matched, n = {n}"), 6 | _ => println!("Default case, x = {:?}", x), 7 | } 8 | println!("at the end: x = {:?}, y = {y}", x); 9 | 10 | let x1 = 4; 11 | let y1 = false; 12 | match x1 { 13 | 4 | 5 | 6 if y1 => println!("yes"), 14 | _ => println!("no"), 15 | } -------------------------------------------------------------------------------- /code/pattern19.rs: -------------------------------------------------------------------------------- 1 | fn some_number() -> Option { 2 | Some(42) 3 | } 4 | 5 | fn main() { 6 | match some_number() { 7 | // Got `Some` variant, match if its value, bound to `n`, 8 | // is equal to 42. 9 | Some(n @ 42) => println!("The Answer: {}!", n), 10 | // Match any other number. 11 | Some(n) => println!("Not interesting... {}", n), 12 | // Match anything else (`None` variant). 13 | _ => (), 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/pattern2.rs: -------------------------------------------------------------------------------- 1 | // while let Conditional Loops 2 | et mut stack = Vec::new(); 3 | stack.push(1); 4 | // ---snip--- 5 | while let Some(top) = stack.pop() { 6 | println!("{}", top); 7 | } 8 | 9 | // for Loops 10 | let v = vec!['a', 'b', 'c']; 11 | for (index, value) in v.iter().enumerate() { 12 | println!("{} is at index {}", value, index); 13 | } 14 | 15 | // let Statements 16 | // let PATTERN = EXPRESSION; 17 | let (x, y, z) = (1, 2, 3); -------------------------------------------------------------------------------- /code/pattern20.rs: -------------------------------------------------------------------------------- 1 | enum Message { 2 | Hello { id: i32 }, 3 | } 4 | 5 | let msg = Message::Hello { id: 5 }; 6 | 7 | match msg { 8 | Message::Hello { 9 | id: id_variable @ 3..=7, 10 | } => println!("Found an id in range: {}", id_variable), 11 | Message::Hello { id: 10..=12 } => { 12 | println!("Found an id in another range") 13 | } 14 | Message::Hello { id } => println!("Found some other id: {}", id), 15 | } -------------------------------------------------------------------------------- /code/pattern3.rs: -------------------------------------------------------------------------------- 1 | fn print_coordinates(&(x, y): &(i32, i32)) { 2 | println!("Current location: ({}, {})", x, y); 3 | } 4 | 5 | fn main() { 6 | let point = (3, 5); 7 | print_coordinates(&point); 8 | } 9 | -------------------------------------------------------------------------------- /code/pattern4.rs: -------------------------------------------------------------------------------- 1 | // | let Some(x) = some_option_value; 2 | // | ^^^^^^^ pattern `None` not covered 3 | 4 | // If we have a refutable pattern where an irrefutable pattern is needed, we can fix it by changing the code that uses the pattern: instead of using let, we can use if let. 5 | if let Some(x) = some_option_value { 6 | println!("{}", x); 7 | } -------------------------------------------------------------------------------- /code/pattern5.rs: -------------------------------------------------------------------------------- 1 | let x = 1; 2 | 3 | match x { 4 | 1 => println!("one"), 5 | 2 => println!("two"), 6 | 3 => println!("three"), 7 | _ => println!("anything"), 8 | } -------------------------------------------------------------------------------- /code/pattern6.rs: -------------------------------------------------------------------------------- 1 | let x = Some(5); 2 | let y = 10; 3 | 4 | match x { 5 | Some(50) => println!("Got 50"), 6 | Some(y) => println!("Matched, y = {y}"), 7 | _ => println!("Default case, x = {:?}", x), 8 | } 9 | 10 | println!("at the end: x = {:?}, y = {y}", x); -------------------------------------------------------------------------------- /code/pattern7.rs: -------------------------------------------------------------------------------- 1 | let x = Some(5); 2 | let y = 10; 3 | 4 | match x { 5 | Some(50) => println!("Got 50"), 6 | Some(y) => println!("Matched, y = {y}"), 7 | _ => println!("Default case, x = {:?}", x), 8 | } 9 | 10 | println!("at the end: x = {:?}, y = {y}", x); -------------------------------------------------------------------------------- /code/pattern8.rs: -------------------------------------------------------------------------------- 1 | let x = 1; 2 | 3 | match x { 4 | 1 | 2 => println!("one or two"), 5 | 3 => println!("three"), 6 | _ => println!("anything"), 7 | } -------------------------------------------------------------------------------- /code/pattern9.rs: -------------------------------------------------------------------------------- 1 | let x = 5; 2 | match x { 3 | 1..=5 => println!("one through five"), 4 | _ => println!("something else"), 5 | } 6 | 7 | let x = 'c'; 8 | match x { 9 | 'a'..='j' => println!("early ASCII letter"), 10 | 'k'..='z' => println!("late ASCII letter"), 11 | _ => println!("something else"), 12 | } -------------------------------------------------------------------------------- /code/profile.shell: -------------------------------------------------------------------------------- 1 | $ cargo build 2 | Finished dev [unoptimized + debuginfo] target(s) in 0.0s 3 | $ cargo build --release 4 | Finished release [optimized] target(s) in 0.0s -------------------------------------------------------------------------------- /code/profile2.toml: -------------------------------------------------------------------------------- 1 | [profile.dev] 2 | opt-level = 0 3 | 4 | [profile.release] 5 | opt-level = 3 -------------------------------------------------------------------------------- /code/references.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let s1 = String::from("hello"); 3 | let len = calculate_length(&s1); 4 | println!("The length of '{}' is {}.", s1, len); 5 | } 6 | 7 | fn calculate_length(s: &String) -> usize { 8 | // s is a reference to a String 9 | s.len() 10 | } // Here, s goes out of scope. But because it does not have ownership of what it refers to, it is not dropped. 11 | -------------------------------------------------------------------------------- /code/result.rs: -------------------------------------------------------------------------------- 1 | enum Result { 2 | Ok(T), 3 | Err(E), 4 | } 5 | -------------------------------------------------------------------------------- /code/result10.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | use std::io; 3 | 4 | fn read_username_from_file() -> Result { 5 | // Reading a file into a string is a fairly common operation, so the standard library provides the convenient fs::read_to_string function. 6 | fs::read_to_string("hello.txt") 7 | } 8 | -------------------------------------------------------------------------------- /code/result11.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | 3 | fn main() { 4 | let greeting_file = File::open("hello.txt")?; 5 | // Error! 6 | // ^ cannot use the `?` operator in a function that returns `()` 7 | // help: the trait `FromResidual>` is not implemented for `()` 8 | } 9 | -------------------------------------------------------------------------------- /code/result12.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | use std::fs::File; 3 | 4 | fn main() -> Result<(), Box> { 5 | let greeting_file = File::open("hello.txt")?; 6 | 7 | Ok(()) 8 | } 9 | -------------------------------------------------------------------------------- /code/result2.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | 3 | fn main() { 4 | let greeting_file_result = File::open("hello.txt"); 5 | 6 | let greeting_file = match greeting_file_result { 7 | Ok(file) => file, 8 | Err(error) => panic!("Problem opening the file: {:?}", error), 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /code/result4.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::ErrorKind; 3 | 4 | fn main() { 5 | let greeting_file = File::open("hello.txt").unwrap_or_else(|error| { 6 | if error.kind() == ErrorKind::NotFound { 7 | File::create("hello.txt").unwrap_or_else(|error| { 8 | panic!("Problem creating the file: {:?}", error); 9 | }) 10 | } else { 11 | panic!("Problem opening the file: {:?}", error); 12 | } 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /code/result5.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | 3 | fn main() { 4 | let greeting_file = File::open("hello.txt").unwrap(); 5 | } 6 | -------------------------------------------------------------------------------- /code/result6.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | 3 | fn main() { 4 | let greeting_file = 5 | File::open("hello.txt").expect("hello.txt should be included in this project"); 6 | } 7 | -------------------------------------------------------------------------------- /code/result7.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::{self, Read}; 3 | 4 | fn read_username_from_file() -> Result { 5 | let mut username_file = File::open("hello.txt")?; // If the value of the Result is an Ok, the value inside the Ok will get returned from this expression, and the program will continue. If the value is an Err, the Err will be returned from the whole function as if we had used the return keyword so the error value gets propagated to the calling code 6 | let mut username = String::new(); 7 | username_file.read_to_string(&mut username)?; 8 | 9 | Ok(username) 10 | } 11 | -------------------------------------------------------------------------------- /code/result8.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::{self, Read}; 3 | 4 | fn read_username_from_file() -> Result { 5 | let username_file_result = File::open("hello.txt"); 6 | 7 | let mut username_file = match username_file_result { 8 | Ok(file) => file, 9 | Err(e) => return Err(e), 10 | }; 11 | 12 | let mut username = String::new(); 13 | 14 | match username_file.read_to_string(&mut username) { 15 | Ok(_) => Ok(username), 16 | Err(e) => Err(e), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /code/result9.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::{self, Read}; 3 | 4 | fn read_username_from_file() -> Result { 5 | let mut username = String::new(); 6 | 7 | File::open("hello.txt")?.read_to_string(&mut username)?; 8 | 9 | Ok(username) 10 | } 11 | -------------------------------------------------------------------------------- /code/scope.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | { 3 | // s is not valid here, it’s not yet declared 4 | let s = "hello"; // s is valid from this point forward 5 | 6 | // do stuff with s 7 | } // this scope is now over, and s is no longer valid 8 | } 9 | -------------------------------------------------------------------------------- /code/shadowing-vs-mutable-var1.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let spaces = " "; 3 | let spaces = spaces.len(); 4 | } 5 | -------------------------------------------------------------------------------- /code/shadowing-vs-mutable-var2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut spaces = " "; 3 | spaces = spaces.len(); 4 | } 5 | -------------------------------------------------------------------------------- /code/shadowing.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 5; 3 | 4 | let x = x + 1; 5 | 6 | { 7 | let x = x * 2; 8 | println!("The value of x in the inner scope is: {x}"); 9 | } 10 | 11 | println!("The value of x is: {x}"); 12 | } 13 | -------------------------------------------------------------------------------- /code/shadowing.shell: -------------------------------------------------------------------------------- 1 | $ cargo run 2 | Compiling variables v0.1.0 (file:///projects/variables) 3 | Finished dev [unoptimized + debuginfo] target(s) in 0.31s 4 | Running `target/debug/variables` 5 | The value of x in the inner scope is: 12 6 | The value of x is: 6 -------------------------------------------------------------------------------- /code/slice.rs: -------------------------------------------------------------------------------- 1 | fn first_word(s: &String) -> usize { 2 | let bytes = s.as_bytes(); 3 | for (i, &item) in bytes.iter().enumerate() { 4 | if item == b' ' { 5 | return i; 6 | } 7 | } 8 | s.len() 9 | } 10 | fn main() { 11 | let mut s = String::from("hello world"); 12 | let word = first_word(&s); // word will get the value 5 13 | s.clear(); // this empties the String, making it equal to "" 14 | // word still has the value 5 here, but there's no more string that 15 | // we could meaningfully use the value 5 with. word is now totally invalid! 16 | } 17 | -------------------------------------------------------------------------------- /code/slice2.rs: -------------------------------------------------------------------------------- 1 | fn first_word(s: &String) -> &str { 2 | let bytes = s.as_bytes(); 3 | 4 | for (i, &item) in bytes.iter().enumerate() { 5 | if item == b' ' { 6 | return &s[0..i]; 7 | } 8 | } 9 | 10 | &s[..] 11 | } 12 | fn main() { 13 | let mut s = String::from("hello world"); 14 | let word = first_word(&s); 15 | s.clear(); // error! 16 | println!("the first word is: {}", word); 17 | } 18 | -------------------------------------------------------------------------------- /code/smart1.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let i = 30; 3 | { 4 | let b = Box::new(i); 5 | dbg!(b); 6 | } 7 | dbg!(i); 8 | } 9 | -------------------------------------------------------------------------------- /code/smart10.rs: -------------------------------------------------------------------------------- 1 | use std::cell::Cell; 2 | 3 | struct PhoneModel { 4 | company_name: String, 5 | model_name: String, 6 | // --- snip --- 7 | on_sale: Cell, 8 | } 9 | 10 | fn main() { 11 | let super_phone_3000 = PhoneModel { 12 | company_name: "YY Electronics".to_string(), 13 | // --- snip --- 14 | on_sale: Cell::new(true), 15 | }; 16 | 17 | super_phone_3000.on_sale.set(false); // mutability inside of something that is immutable 18 | } 19 | -------------------------------------------------------------------------------- /code/smart13.rs: -------------------------------------------------------------------------------- 1 | use crate::List::{Cons, Nil}; 2 | use std::cell::RefCell; 3 | use std::rc::Rc; 4 | 5 | #[derive(Debug)] 6 | enum List { 7 | Cons(i32, RefCell>), 8 | Nil, 9 | } 10 | 11 | impl List { 12 | fn tail(&self) -> Option<&RefCell>> { 13 | match self { 14 | Cons(_, item) => Some(item), 15 | Nil => None, 16 | } 17 | } 18 | } 19 | 20 | fn main() {} 21 | -------------------------------------------------------------------------------- /code/smart15.rs: -------------------------------------------------------------------------------- 1 | use std::cell::RefCell; 2 | use std::rc::Rc; 3 | 4 | #[derive(Debug)] 5 | struct Node { 6 | value: i32, 7 | children: RefCell>>, 8 | } 9 | fn main() { 10 | let leaf = Rc::new(Node { 11 | value: 3, 12 | children: RefCell::new(vec![]), 13 | }); 14 | 15 | let branch = Rc::new(Node { 16 | value: 5, 17 | children: RefCell::new(vec![Rc::clone(&leaf)]), 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /code/smart2.rs: -------------------------------------------------------------------------------- 1 | enum List { 2 | Cons(i32, Box), 3 | Nil, 4 | } 5 | 6 | use crate::List::{Cons, Nil}; 7 | 8 | fn main() { 9 | let list = Cons(1, Box::new(Cons(2, Box::new(Cons(3, Box::new(Nil)))))); 10 | } 11 | -------------------------------------------------------------------------------- /code/smart3.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 5; 3 | let y = &x; 4 | 5 | assert_eq!(5, x); 6 | assert_eq!(5, *y); 7 | } 8 | -------------------------------------------------------------------------------- /code/smart4.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 5; 3 | let y = Box::new(x); 4 | 5 | assert_eq!(5, x); 6 | assert_eq!(5, *y); 7 | } 8 | -------------------------------------------------------------------------------- /code/smart5.rs: -------------------------------------------------------------------------------- 1 | use std::ops::Deref; 2 | struct MyBox(T); 3 | impl MyBox { 4 | fn new(x: T) -> MyBox { 5 | MyBox(x) 6 | } 7 | } 8 | impl Deref for MyBox { 9 | type Target = T; 10 | 11 | fn deref(&self) -> &Self::Target { 12 | &self.0 13 | } 14 | } 15 | fn main() { 16 | let x = 5; 17 | let y = MyBox::new(x); 18 | 19 | assert_eq!(5, x); 20 | assert_eq!(5, *y); // Rust actually ran this code: *(y.deref()) 21 | } 22 | -------------------------------------------------------------------------------- /code/smart6.rs: -------------------------------------------------------------------------------- 1 | fn hello(name: &str) { 2 | println!("Hello, {name}!"); 3 | } 4 | 5 | fn main() { 6 | let m = MyBox::new(String::from("Rust")); 7 | hello(&m); 8 | } 9 | -------------------------------------------------------------------------------- /code/smart7.rs: -------------------------------------------------------------------------------- 1 | struct CustomSmartPointer { 2 | data: String, 3 | } 4 | impl Drop for CustomSmartPointer { 5 | fn drop(&mut self) { 6 | println!("Dropping CustomSmartPointer with data `{}`!", self.data); 7 | } 8 | } 9 | fn main() { 10 | let c = CustomSmartPointer { 11 | data: String::from("my stuff"), 12 | }; 13 | { 14 | let d = CustomSmartPointer { 15 | data: String::from("other stuff"), 16 | }; 17 | } // std::mem::drop(d) 18 | println!("CustomSmartPointers created."); 19 | } 20 | -------------------------------------------------------------------------------- /code/smart8.rs: -------------------------------------------------------------------------------- 1 | enum List { 2 | Cons(i32, Box), 3 | Nil, 4 | } 5 | 6 | use crate::List::{Cons, Nil}; 7 | 8 | fn main() { 9 | let a = Cons(5, Box::new(Cons(10, Box::new(Nil)))); 10 | let b = Cons(3, Box::new(a)); 11 | let c = Cons(4, Box::new(a)); 12 | } 13 | -------------------------------------------------------------------------------- /code/smart9.rs: -------------------------------------------------------------------------------- 1 | enum List { 2 | Cons(i32, Rc), 3 | Nil, 4 | } 5 | 6 | use crate::List::{Cons, Nil}; 7 | use std::rc::Rc; 8 | 9 | fn main() { 10 | let a = Rc::new(Cons(5, Rc::new(Cons(10, Rc::new(Nil))))); 11 | let b = Cons(3, Rc::clone(&a)); 12 | let c = Cons(4, Rc::clone(&a)); 13 | } 14 | -------------------------------------------------------------------------------- /code/statements-expressions.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let y = { 3 | let x = 3; 4 | x + 1 5 | }; 6 | 7 | println!("The value of y is: {y}"); // 4 8 | } 9 | -------------------------------------------------------------------------------- /code/string-slice.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let s = String::from("hello world"); 3 | 4 | let hello = &s[0..5]; 5 | let world = &s[6..11]; 6 | 7 | let slice = &s[0..2]; 8 | let slice = &s[..2]; 9 | 10 | let slice = &s[3..len]; 11 | let slice = &s[3..]; 12 | } 13 | -------------------------------------------------------------------------------- /code/string_vec.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s0 = String::new(); 3 | 4 | let data = "initial contents"; 5 | let s1 = data.to_string(); 6 | 7 | // the method also works on a literal directly: 8 | let s2 = "initial contents".to_string(); 9 | 10 | let s3 = String::from("initial contents"); 11 | } 12 | -------------------------------------------------------------------------------- /code/string_vec2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s0 = String::new(); 3 | 4 | let data = "initial contents"; 5 | let s1 = data.to_string(); 6 | 7 | // the method also works on a literal directly: 8 | let s2 = "initial contents".to_string(); 9 | 10 | let s3 = String::from("initial contents"); 11 | } 12 | -------------------------------------------------------------------------------- /code/struct-build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // --snip-- 3 | let user2 = User { 4 | active: user1.active, 5 | username: user1.username, 6 | email: String::from("another@example.com"), 7 | sign_in_count: user1.sign_in_count, 8 | }; 9 | } 10 | fn main_less_code() { 11 | // --snip-- 12 | let user2 = User { 13 | email: String::from("another@example.com"), 14 | ..user1 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /code/struct-err.rs: -------------------------------------------------------------------------------- 1 | 2 | let mut user1 = User { 3 | email: String::from("someone@example.com"), 4 | username: String::from("someusername123"), 5 | active: true, 6 | sign_in_count: 1, 7 | }; 8 | 9 | let user2 = User { 10 | email: String::from("another@example.com"), 11 | ..user1 12 | }; 13 | println!("{:#?}", user1); 14 | -------------------------------------------------------------------------------- /code/struct-err2.shell: -------------------------------------------------------------------------------- 1 | error[E0382]: borrow of partially moved value: `user1` 2 | --> src/main.rs:22:23 3 | | 4 | 18 | let user2 = User { 5 | | _________________- 6 | 19 | | email: String::from("another@example.com"), 7 | 20 | | ..user1 8 | 21 | | }; 9 | | |_____- value partially moved here 10 | 22 | println!("{:#?}", user1); 11 | | ^^^^^ value borrowed here after partial move 12 | | 13 | = note: partial move occurs because `user1.username` has type `String`, which does not implement the `Copy` trait -------------------------------------------------------------------------------- /code/struct.rs: -------------------------------------------------------------------------------- 1 | struct User { 2 | active: bool, 3 | username: String, 4 | email: String, 5 | sign_in_count: u64, 6 | } 7 | fn main() { 8 | let mut user1 = User { 9 | email: String::from("someone@example.com"), 10 | username: String::from("someusername123"), 11 | active: true, 12 | sign_in_count: 1, 13 | }; 14 | 15 | user1.email = String::from("anotheremail@example.com"); 16 | } 17 | -------------------------------------------------------------------------------- /code/test1.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | let result = 2 + 2; 6 | assert_eq!(result, 4); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /code/test1.shell: -------------------------------------------------------------------------------- 1 | $ cargo test 2 | ... 3 | 4 | running 1 test 5 | test tests::it_works ... ok 6 | 7 | test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s 8 | ... -------------------------------------------------------------------------------- /code/test10.rs: -------------------------------------------------------------------------------- 1 | pub fn setup() { 2 | // setup code specific to your library's tests would go here 3 | } 4 | -------------------------------------------------------------------------------- /code/test11.rs: -------------------------------------------------------------------------------- 1 | use adder; 2 | mod common; 3 | #[test] 4 | fn it_adds_two() { 5 | common::setup(); 6 | assert_eq!(4, adder::add_two(2)); 7 | } 8 | -------------------------------------------------------------------------------- /code/test2.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn exploration() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | 8 | #[test] 9 | fn another() { 10 | panic!("Make this test fail"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/test3.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | use super::*; 4 | 5 | #[test] 6 | fn larger_can_hold_smaller() { 7 | let larger = Rectangle { 8 | width: 8, 9 | height: 7, 10 | }; 11 | let smaller = Rectangle { 12 | width: 5, 13 | height: 1, 14 | }; 15 | 16 | assert!(larger.can_hold(&smaller)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /code/test4.rs: -------------------------------------------------------------------------------- 1 | pub fn add_two(a: i32) -> i32 { 2 | a + 2 3 | } 4 | 5 | #[cfg(test)] 6 | mod tests { 7 | use super::*; 8 | 9 | #[test] 10 | fn it_adds_two() { 11 | assert_eq!(4, add_two(2)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /code/test5.rs: -------------------------------------------------------------------------------- 1 | pub fn greeting(name: &str) -> String { 2 | format!("Hello {}!", name) 3 | } 4 | #[cfg(test)] 5 | mod tests { 6 | use super::*; 7 | #[test] 8 | fn greeting_contains_name() { 9 | let result = greeting("Carol"); 10 | assert!( 11 | result.contains("Carol"), 12 | "Greeting did not contain name, value was `{}`", 13 | result 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /code/test6.rs: -------------------------------------------------------------------------------- 1 | pub struct Guess { 2 | value: i32, 3 | } 4 | impl Guess { 5 | pub fn new(value: i32) -> Guess { 6 | if value < 1 || value > 100 { 7 | panic!("Guess value must be between 1 and 100, got {}.", value); 8 | } 9 | Guess { value } 10 | } 11 | } 12 | #[cfg(test)] 13 | mod tests { 14 | use super::*; 15 | #[test] 16 | #[should_panic] 17 | fn greater_than_100() { 18 | Guess::new(200); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /code/test7.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() -> Result<(), String> { 5 | if 2 + 2 == 4 { 6 | Ok(()) 7 | } else { 8 | Err(String::from("two plus two does not equal four")) 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /code/test8.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | #[ignore] 3 | fn expensive_test() { 4 | // code that takes an hour to run 5 | } 6 | -------------------------------------------------------------------------------- /code/test9.rs: -------------------------------------------------------------------------------- 1 | // Each file in the tests directory is a separate crate, so we need to bring our library into each test crate’s scope. 2 | use adder; 3 | 4 | #[test] 5 | fn it_adds_two() { 6 | assert_eq!(4, adder::add_two(2)); 7 | } 8 | -------------------------------------------------------------------------------- /code/thread1.rs: -------------------------------------------------------------------------------- 1 | use std::thread; 2 | use std::time::Duration; 3 | 4 | fn main() { 5 | let handle = thread::spawn(|| { 6 | for i in 1..10 { 7 | println!("hi number {} from the spawned thread!", i); 8 | thread::sleep(Duration::from_millis(1)); 9 | } 10 | }); 11 | 12 | for i in 1..5 { 13 | println!("hi number {} from the main thread!", i); 14 | thread::sleep(Duration::from_millis(1)); 15 | } 16 | 17 | handle.join().unwrap(); 18 | } 19 | -------------------------------------------------------------------------------- /code/thread2.rs: -------------------------------------------------------------------------------- 1 | use std::thread; 2 | 3 | fn main() { 4 | let v = vec![1, 2, 3]; 5 | 6 | let handle = thread::spawn(|| { 7 | println!("Here's a vector: {:?}", v); 8 | }); 9 | 10 | handle.join().unwrap(); 11 | } 12 | -------------------------------------------------------------------------------- /code/thread3.rs: -------------------------------------------------------------------------------- 1 | use std::thread; 2 | 3 | fn main() { 4 | let v = vec![1, 2, 3]; 5 | 6 | let handle = thread::spawn(|| { 7 | println!("Here's a vector: {:?}", v); 8 | }); 9 | 10 | drop(v); // oh no! 11 | 12 | handle.join().unwrap(); -------------------------------------------------------------------------------- /code/thread4.rs: -------------------------------------------------------------------------------- 1 | use std::thread; 2 | 3 | fn main() { 4 | let v = vec![1, 2, 3]; 5 | 6 | let handle = thread::spawn(|| { 7 | println!("Here's a vector: {:?}", v); 8 | }); 9 | 10 | drop(v); // oh no! 11 | 12 | handle.join().unwrap(); -------------------------------------------------------------------------------- /code/thread5.rs: -------------------------------------------------------------------------------- 1 | use std::sync::mpsc; 2 | use std::thread; 3 | fn main() { 4 | // The mpsc::channel function returns a tuple, the first element of which is the sending end--the transmitter--and the second element is the receiving end--the receiver. The abbreviations tx and rx are traditionally used in many fields for transmitter and receiver respectively. 5 | let (tx, rx) = mpsc::channel(); 6 | 7 | thread::spawn(move || { 8 | let val = String::from("hi"); 9 | tx.send(val).unwrap(); 10 | }); 11 | 12 | let received = rx.recv().unwrap(); 13 | println!("Got: {}", received); 14 | } 15 | -------------------------------------------------------------------------------- /code/thread6.rs: -------------------------------------------------------------------------------- 1 | use std::sync::mpsc; 2 | use std::thread; 3 | 4 | fn main() { 5 | let (tx, rx) = mpsc::channel(); 6 | 7 | thread::spawn(move || { 8 | let val = String::from("hi"); 9 | tx.send(val).unwrap(); 10 | println!("val is {}", val); 11 | }); 12 | 13 | let received = rx.recv().unwrap(); 14 | println!("Got: {}", received); 15 | } 16 | -------------------------------------------------------------------------------- /code/thread7.rs: -------------------------------------------------------------------------------- 1 | // --snip-- 2 | let (tx, rx) = mpsc::channel(); 3 | // producer 1 4 | let tx1 = tx.clone(); 5 | thread::spawn(move || { 6 | let vals = vec![ 7 | String::from("hi"), 8 | // --snip-- 9 | ]; 10 | for val in vals { 11 | tx1.send(val).unwrap(); 12 | // --snip-- 13 | } 14 | }); -------------------------------------------------------------------------------- /code/thread8.rs: -------------------------------------------------------------------------------- 1 | // producer 2 2 | thread::spawn(move || { 3 | let vals = vec![ 4 | String::from("more"), 5 | // --snip-- 6 | ]; 7 | for val in vals { 8 | tx.send(val).unwrap(); 9 | // --snip-- 10 | } 11 | }); 12 | 13 | for received in rx { 14 | println!("Got: {}", received); 15 | } -------------------------------------------------------------------------------- /code/tuple-struct.rs: -------------------------------------------------------------------------------- 1 | struct Color(i32, i32, i32); 2 | struct Point(i32, i32, i32); 3 | 4 | fn main() { 5 | let black = Color(0, 0, 0); 6 | let origin = Point(0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /code/tuple-types.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let tup = (500, 6.4, 1); 3 | let (x, y, z) = tup; 4 | println!("The value of y is: {y}"); // 6.4 5 | 6 | let five_hundred = tup.0; 7 | let six_point_four = tup.1; 8 | let one = tup.2; 9 | } 10 | -------------------------------------------------------------------------------- /code/type1.rs: -------------------------------------------------------------------------------- 1 | type Kilometers = i32; 2 | -------------------------------------------------------------------------------- /code/type2.rs: -------------------------------------------------------------------------------- 1 | type Kilometers = i32; 2 | 3 | let x: i32 = 5; 4 | let y: Kilometers = 5; 5 | // Because Kilometers and i32 are the same type, we can add values of both types and we can pass Kilometers values to functions that take i32 parameters. 6 | println!("x + y = {}", x + y); -------------------------------------------------------------------------------- /code/type3.rs: -------------------------------------------------------------------------------- 1 | use std::ops::Add; 2 | 3 | struct Millimeters(u32); 4 | struct Meters(u32); 5 | 6 | impl Add for Millimeters { 7 | type Output = Millimeters; 8 | 9 | fn add(self, other: Meters) -> Millimeters { 10 | Millimeters(self.0 + (other.0 * 1000)) 11 | } 12 | } 13 | 14 | fn main() { 15 | let x: u32 = 5; 16 | let y: Millimeters = Millimeters(10); 17 | println!("x + y = {}", x + y); 18 | // ^ no implementation for `u32 + Millimeters` 19 | } 20 | -------------------------------------------------------------------------------- /code/type4.rs: -------------------------------------------------------------------------------- 1 | type Thunk = Box; 2 | 3 | let f: Thunk = Box::new(|| println!("hi")); 4 | 5 | fn takes_long_type(f: Thunk) { 6 | // --snip-- 7 | } 8 | 9 | fn returns_long_type() -> Thunk { 10 | // --snip-- 11 | } -------------------------------------------------------------------------------- /code/type5.rs: -------------------------------------------------------------------------------- 1 | fn bar() -> ! { 2 | // --snip-- 3 | } 4 | -------------------------------------------------------------------------------- /code/type6.rs: -------------------------------------------------------------------------------- 1 | fn generic(t: T) { 2 | // --snip-- 3 | } 4 | // is actually treated as though we had written this: 5 | fn generic(t: T) { 6 | // --snip-- 7 | } 8 | -------------------------------------------------------------------------------- /code/type7.rs: -------------------------------------------------------------------------------- 1 | fn generic(t: T) { 2 | // --snip-- 3 | } 4 | 5 | fn generic(t: &T) { 6 | // --snip-- 7 | } 8 | -------------------------------------------------------------------------------- /code/unit-like-struct.rs: -------------------------------------------------------------------------------- 1 | struct AlwaysEqual; 2 | 3 | fn main() { 4 | let subject = AlwaysEqual; 5 | } 6 | -------------------------------------------------------------------------------- /code/unsafe1.rs: -------------------------------------------------------------------------------- 1 | let mut num = 5; 2 | // Create raw pointers in safe code; we just can’t dereference raw pointers outside an unsafe block 3 | let r1 = &num as *const i32; 4 | let r2 = &mut num as *mut i32; 5 | unsafe { 6 | println!("r1 is: {}", *r1); 7 | println!("r2 is: {}", *r2); 8 | } -------------------------------------------------------------------------------- /code/unsafe2.rs: -------------------------------------------------------------------------------- 1 | unsafe fn dangerous() {} 2 | 3 | unsafe { 4 | dangerous(); 5 | } -------------------------------------------------------------------------------- /code/unsafe4.rs: -------------------------------------------------------------------------------- 1 | use std::slice; 2 | 3 | fn split_at_mut(values: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) { 4 | let len = values.len(); 5 | let ptr = values.as_mut_ptr(); 6 | 7 | assert!(mid <= len); 8 | 9 | unsafe { 10 | ( 11 | slice::from_raw_parts_mut(ptr, mid), 12 | slice::from_raw_parts_mut(ptr.add(mid), len - mid), 13 | ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/unsafe5.rs: -------------------------------------------------------------------------------- 1 | extern "C" { 2 | fn abs(input: i32) -> i32; 3 | } 4 | 5 | fn main() { 6 | unsafe { 7 | println!("Absolute value of -3 according to C: {}", abs(-3)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /code/unsafe6.rs: -------------------------------------------------------------------------------- 1 | #[no_mangle] 2 | pub extern "C" fn call_from_c() { 3 | println!("Just called a Rust function from C!"); 4 | } 5 | -------------------------------------------------------------------------------- /code/unsafe7.rs: -------------------------------------------------------------------------------- 1 | static mut COUNTER: u32 = 0; 2 | 3 | fn add_to_count(inc: u32) { 4 | unsafe { 5 | COUNTER += inc; 6 | } 7 | } 8 | 9 | fn main() { 10 | add_to_count(3); 11 | 12 | unsafe { 13 | println!("COUNTER: {}", COUNTER); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /code/unsafe8.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused)] 2 | fn main() { 3 | union MyUnion { 4 | f1: u32, 5 | f2: f32, 6 | } 7 | 8 | let u = MyUnion { f1: 1 }; 9 | let f = unsafe { u.f1 }; 10 | } 11 | // see https://doc.rust-lang.org/reference/items/unions.html 12 | -------------------------------------------------------------------------------- /code/vector.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let v1: Vec = Vec::new(); // We added a type annotation here, because we aren’t inserting any values into this vector, Rust doesn’t know what kind of elements we intend to store 3 | 4 | // More often, you’ll create a Vec with initial values and Rust will infer the type of value you want to store, so you rarely need to do this type annotation. Rust conveniently provides the vec! macro, which will create a new vector that holds the values you give it. 5 | let v2 = vec![1, 2, 3]; 6 | 7 | let mut v3 = Vec::new(); 8 | v3.push(5); 9 | v3.push(6); 10 | } 11 | -------------------------------------------------------------------------------- /code/vector2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let v = vec![1, 2, 3, 4, 5]; 3 | 4 | let third: &i32 = &v[2]; 5 | println!("The third element is {third}"); 6 | 7 | let third: Option<&i32> = v.get(2); 8 | match third { 9 | Some(third) => println!("The third element is {third}"), 10 | None => println!("There is no third element."), 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /code/vector3.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let v = vec![100, 32, 57]; 3 | for i in &v { 4 | println!("{i}"); 5 | } 6 | 7 | for i in &mut v { 8 | *i += 50; // we have to use the * dereference operator to get to the value in i before we can use the += operator 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /code/vector4.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | enum SpreadsheetCell { 3 | Int(i32), 4 | Float(f64), 5 | Text(String), 6 | } 7 | 8 | let row = vec![ 9 | SpreadsheetCell::Int(3), 10 | SpreadsheetCell::Text(String::from("blue")), 11 | SpreadsheetCell::Float(10.12), 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /code/while.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut number = 3; 3 | 4 | while number != 0 { 5 | println!("{number}!"); 6 | 7 | number -= 1; 8 | } 9 | 10 | println!("LIFTOFF!!!"); 11 | } 12 | -------------------------------------------------------------------------------- /img/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/.DS_Store -------------------------------------------------------------------------------- /img/char.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/char.png -------------------------------------------------------------------------------- /img/closure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/closure.png -------------------------------------------------------------------------------- /img/graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/graph.png -------------------------------------------------------------------------------- /img/package.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/package.jpeg -------------------------------------------------------------------------------- /img/rust-project-folder-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/rust-project-folder-structure.png -------------------------------------------------------------------------------- /img/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/test.png -------------------------------------------------------------------------------- /img/test2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/test2.png -------------------------------------------------------------------------------- /img/trpl04-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl04-01.png -------------------------------------------------------------------------------- /img/trpl04-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl04-02.png -------------------------------------------------------------------------------- /img/trpl04-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl04-03.png -------------------------------------------------------------------------------- /img/trpl04-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl04-04.png -------------------------------------------------------------------------------- /img/trpl04-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl04-05.png -------------------------------------------------------------------------------- /img/trpl04-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl04-06.png -------------------------------------------------------------------------------- /img/trpl04-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl04-07.png -------------------------------------------------------------------------------- /img/trpl14-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl14-01.png -------------------------------------------------------------------------------- /img/trpl14-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl14-02.png -------------------------------------------------------------------------------- /img/trpl15-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/trpl15-04.png -------------------------------------------------------------------------------- /img/workspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/img/workspace.png -------------------------------------------------------------------------------- /read.men: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/read.men -------------------------------------------------------------------------------- /rust.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/rust.pdf -------------------------------------------------------------------------------- /rust.snm: -------------------------------------------------------------------------------- 1 | \beamer@slide {fig:folderRustLang}{8} 2 | \beamer@slide {fig:figureS1}{58} 3 | \beamer@slide {fig:figureS2}{59} 4 | \beamer@slide {fig:figureSAnotherPossibility}{60} 5 | \beamer@slide {fig:figureMove}{64} 6 | \beamer@slide {fig:figureSAnotherPossibility2}{66} 7 | \beamer@slide {fig:figureRef}{72} 8 | -------------------------------------------------------------------------------- /rust.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yumcoder-dev/learn-rust-lang/4896e4991dd7c8f1f6f13af3c84cbcab64c8b7ab/rust.synctex.gz -------------------------------------------------------------------------------- /rust.vrb: -------------------------------------------------------------------------------- 1 | \frametitle{Change in the Worker loop} 2 | \inputminted{rust}{./code/http19.rs} 3 | --------------------------------------------------------------------------------